전체 κΈ€

전체 κΈ€

    [Trouble Shooting] Swagger-uiλ₯Ό μ ‘μ†ν–ˆμ„ λ•Œ 404 errorκ°€ λ‚˜λŠ” 경우

    [Trouble Shooting] Swagger-uiλ₯Ό μ ‘μ†ν–ˆμ„ λ•Œ 404 errorκ°€ λ‚˜λŠ” 경우

    이전 ν”„λ‘œμ νŠΈμ—μ„œ Swaggerλ₯Ό μ‚¬μš©ν•΄ 같은 μ„€μ •μœΌλ‘œ Swaggerλ₯Ό Config ν–ˆμœΌλ‚˜, λ‘œμ»¬μ—μ„œ ν•΄λ‹Ή URL둜 μ ‘μ†ν–ˆμ„ λ•Œ 404 Errorκ°€ λ‚˜μ˜€λŠ” ν˜„μƒμ„ λ°œκ²¬ν–ˆλ‹€. 문제의 원인은 달라진 μŠ€ν”„λ§ λΆ€νŠΈμ˜ λ²„μ „μœΌλ‘œ, μ΄μ „μ—λŠ” 2버전을 μ‚¬μš©ν–ˆλ‹€λ©΄ μ§€κΈˆμ€ 3버전을 μ„ νƒν–ˆκΈ° λ•Œλ¬Έμ— λ°œμƒν•œ 였λ₯˜λ‹€. 해결책을 찾은곳은 Stack Overflowμ˜€λ‹€. https://stackoverflow.com/questions/74614369/how-to-run-swagger-3-on-spring-boot-3 How to run Swagger 3 on Spring Boot 3 Using a fresh Spring Initialzr with Java17 and Spring Boot 3.0.0, and an extra addi..

    [ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€] μž…κ΅­μ‹¬μ‚¬ (level3, python)

    [ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€] μž…κ΅­μ‹¬μ‚¬ (level3, python)

    πŸ€” 풀이 μ½”λ“œ def check(n, times, k): can_enter = 0 for t in times: can_enter += k // t return True if can_enter >= n else False def solution(n, times): answer = 0 start = 0 end = min(times) * n mid = start while mid + 1 != end: mid = (start + end) // 2 if check(n, times, mid): end = mid else: start = mid return end πŸ€” 문제 풀이 μ΄λΆ„νƒμƒ‰μœΌλ‘œ 풀이해야 ν•˜λŠ” λ¬Έμ œμž…λ‹ˆλ‹€. 항상 이뢄 탐색은 μ‹œμž‘μ κ³Ό 끝점을 μž‘λŠ” κΈ°μ€€κ³Ό, μ–΄λ–€ 것을 이뢄탐색에 μ‚¬μš©ν•΄μ•Ό 할지 νŒλ‹¨ν•˜λŠ”κ²Œ μ–΄λ ΅λ„€..

    [DEVLOG] @Builder와 @Builder.Default

    [DEVLOG] @Builder와 @Builder.Default

    πŸ€” @Builderκ°€ λ‹¬λ €μžˆλŠ” 클래슀의 ν•„λ“œλ₯Ό μ΄ˆκΈ°ν™”ν•΄μ€¬λŠ”λ°, μ™œ λΉŒλ” νŒ¨ν„΄μ„ μ‚¬μš©ν•˜λ©΄ μ΄ˆκΈ°ν™” 값이 μ•„λ‹Œ Null이 λ‚˜μ˜€μ§€? πŸͺ„ GTAccountInfo μ—”ν‹°ν‹°μ˜ μ½”λ“œ 일뢀 @Slf4j @Builder @NoArgsConstructor @AllArgsConstructor @Entity(name = "gt_account_info") public class GTAccountInfo { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(name = "ACCOUNT_ID") private long id; @Getter @Column(name = "account_email") private String accountEmail; @Getter @Col..

    [DEVLOG] JUnit5λ₯Ό ν™œμš©ν•œ ν…ŒμŠ€νŠΈ μ½”λ“œ μž‘μ„±κ³Ό @DataJpaTest μ‚¬μš©μ‹œ λ°œμƒν•œ 문제 ν•΄κ²°

    [DEVLOG] JUnit5λ₯Ό ν™œμš©ν•œ ν…ŒμŠ€νŠΈ μ½”λ“œ μž‘μ„±κ³Ό @DataJpaTest μ‚¬μš©μ‹œ λ°œμƒν•œ 문제 ν•΄κ²°

    πŸ€” Spring Data JPAλ₯Ό μ‚¬μš©ν•˜λ©΄μ„œ JPA κ΄€λ ¨ ν…ŒμŠ€νŠΈλ§Œ μ§„ν–‰ν•˜κ³  싢을 λ•Œ λͺ¨λ“  λΉˆμ„ λ“±λ‘ν•˜λŠ” @SpringBootTest μ–΄λ…Έν…Œμ΄μ…˜μ„ μ‚¬μš©ν•˜λ©΄ μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ 규λͺ¨κ°€ 컀질 수둝 속도가 λŠλ €μ§‘λ‹ˆλ‹€. ν•˜μ§€λ§Œ, JPA κ΄€λ ¨ ν…ŒμŠ€νŠΈλ§Œ μ§„ν–‰ν•˜κ³  싢은 κ²½μš°κ°€ λΆ„λͺ…ν•˜κ²Œ μ‘΄μž¬ν•©λ‹ˆλ‹€. 이와 같은 κ²½μš°μ—λŠ”, @DataJpaTest μ–΄λ…Έν…Œμ΄μ…˜μ„ μ‚¬μš©ν•©λ‹ˆλ‹€. @DataJpaTest class GTMemberEntityTest{ @Autowired private GTAccountInfoRepository accountInfoRepository; @Autowired private GTMemberInfoRepository memberInfoRepository; @Autowired private GTAccountUserRo..

    [ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€] 거리두기 ν™•μΈν•˜κΈ° (level2, python)

    [ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€] 거리두기 ν™•μΈν•˜κΈ° (level2, python)

    πŸ€” 풀이 μ½”λ“œ from collections import deque def bfs(start, place): queue = deque() queue.append([start[0], start[1], 0]) visited = [[False for _ in range(5)] for _ in range(5)] visited[start[0]][start[1]] = True dx = [0, 0, -1, 1] dy = [1, -1, 0, 0] candidate = [] while queue: a, b, dist = queue.popleft() for i in range(4): nx = dx[i] + a ny = dy[i] + b if 0

    [ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€] λ©€μ©‘ν•œ μ‚¬κ°ν˜• (level2, python)

    [ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€] λ©€μ©‘ν•œ μ‚¬κ°ν˜• (level2, python)

    πŸ€” 풀이 μ½”λ“œ import math def solution(w,h): return w * h - (w + h - math.gcd(w, h)) πŸ€” 문제 풀이 μ½”λ“œκ°€ μ§§μ•„μ„œ μ‰¬μš΄ 문제처럼 λ³΄μ΄μ§€λ§Œ, μ™œ μ €λŸ° 식이 λ‚˜μ™”λŠ”μ§€ μ΄ν•΄ν•˜λŠ” 것이 μ€‘μš”ν•©λ‹ˆλ‹€. λ¬Έμ œμ—μ„œ λ‚˜μ˜¨ 이 μ˜ˆμ‹œλ₯Ό ν•œ 번 λ΄…μ‹œλ‹€. κ°€λ‘œ 8, μ„Έλ‘œ 12의 μ‚¬κ°ν˜•μœΌλ‘œ, μΌμ •ν•œ νŒ¨ν„΄μ΄ λ°˜λ³΅λ˜λŠ” κ²ƒμ²˜λŸΌ λ³΄μž…λ‹ˆλ‹€. μœ„μ™€ 같은 κ°€λ‘œ 2, μ„Έλ‘œ 3의 μ‚¬κ°ν˜•μ˜ νŒ¨ν„΄μ΄ μ—¬λŸ¬ 번 λ°˜λ³΅λ˜λŠ” κ²ƒμ²˜λŸΌ 보이죠. κ³„μ‚°ν•˜λ©΄, κ°€λ‘œ 8 μ„Έλ‘œ 12의 μ‚¬κ°ν˜•μ€, κ°€λ‘œ 2, μ„Έλ‘œ 3의 μ‚¬κ°ν˜•μ—μ„œ 선에 κ±Έλ¦¬λŠ” μ‚¬κ°ν˜•μ˜ 개수 * 4μž…λ‹ˆλ‹€. μ—¬κΈ°μ„œ 4λΌλŠ” μˆ«μžλŠ”, 8κ³Ό 12의 μ΅œλŒ€ κ³΅μ•½μˆ˜μΈκ²ƒμ„ μ•Œ 수 μžˆμŠ΅λ‹ˆλ‹€. λ˜ν•œ κ°€λ‘œ 2와 μ„Έλ‘œ 3은 μ„œλ‘œμ†Œ κ΄€κ³„μž„μ„ μ•Œ 수 있죠. λ”°λΌμ„œ μ΅œλŒ€ κ³΅μ•½μˆ˜λ₯Ό ..

    [ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€] μ—¬ν–‰κ²½λ‘œ (level3, python)

    [ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€] μ—¬ν–‰κ²½λ‘œ (level3, python)

    πŸ€” 풀이 μ½”λ“œ from collections import deque import copy def bfs(start, ways, visited, n): queue = deque() queue.append([start, start, visited]) candidate = [] while queue: now, log, visit = queue.popleft() if len(log) == 4 * n - 1: candidate.append(log) continue for next in ways[now]: visited_key = now + next if visit[visited_key] != 0: visit[visited_key] -= 1 queue.append([next, log + " " + next, cop..

    [ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€] λ””μŠ€ν¬ 컨트둀러 (level3, python)

    [ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€] λ””μŠ€ν¬ 컨트둀러 (level3, python)

    πŸ€” 풀이 μ½”λ“œ import heapq from collections import deque def solution(jobs): # jobs : [μž‘μ—…μ΄ μš”μ²­λ˜λŠ” μ‹œμ , μž‘μ—…μ˜ μ†Œμš”μ‹œκ°„] answer = [] job_queue = deque(sorted(jobs, key=lambda x : x[0])) heap = [] time = 0 while job_queue or heap: # μž‘μ—… νμ—μ„œ μ‹€ν–‰κ°€λŠ₯ν•œ νž™μœΌλ‘œ 이동 while job_queue and job_queue[0][0]