소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Suppose an array of length n sorted in ascending order is rotated between 1 and n times. For example, the array nums = [0,1,2,4,5,6,7] might become: [4,5,6,7,0,1,2] if it was rotated 4 times. [0,1,2,4,5,6,7] if it was rotated 7 times. Notice that rotating an array [a[0], a[1], a[2], ..., a[n-1]] 1 time results in the array [a[n-1], a[0], a[1], a[2], ..., a[n-..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given a sorted integer array nums and an integer n, add/patch elements to the array such that any number in the range [1, n] inclusive can be formed by the sum of some elements in the array. Return the minimum number of patches required. Example 1: Input: nums = [1,3], n = 6 Output: 1 Explanation: Combinations of nums are [1], [3], [1,3], which form possible ..
Problem One way to serialize a binary tree is to use preorder traversal. When we encounter a non-null node, we record the node's value. If it is a null node, we record using a sentinel value such as '#'. For example, the above binary tree can be serialized to the string "9,3,4,#,#,1,#,#,2,#,6,#,#", where '#' represents a null node. Given a string of comma-separated values pre..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given a non-negative integer c, decide whether there are two integers a and b such that a^2 + b^2 = c. Example 1: Input: c = 5 Output: true Explanation: 1 * 1 + 2 * 2 = 5 Example 2: Input: c = 3 Output: false Example 3: Input: c = 4 Output: true Example 4: Input: c = 2 Output: true Example 5: Input: c = 1 Output: true Constraints: 0 test(14, false) ); } priva..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem A complex number can be represented as a string on the form "real+imaginaryi" where: real is the real part and is an integer in the range [-100, 100]. imaginary is the imaginary part and is an integer in the range [-100, 100]. i^2 == -1. Given two complex numbers num1 and num2 as strings, return a string of the complex number that represents their multiplicat..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given the root of a Binary Search Tree and a target number k, return true if there exist two elements in the BST such that their sum is equal to the given target. Example 1: Input: root = [5,3,6,2,4,null,7], k = 9 Output: trueExample 2: Input: root = [5,3,6,2,4,null,7], k = 28 Output: falseExample 3: Input: root = [2,1,3], k = 4 Output: trueExample 4: Input: ..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem We are given a list of (axis-aligned) rectangles. Each rectangle[i] = [xi1, yi1, xi2, yi2] , where (xi1, yi1) are the coordinates of the bottom-left corner, and (xi2, yi2) are the coordinates of the top-right corner of the ith rectangle. Find the total area covered by all rectangles in the plane. Since the answer may be too large, return it modulo 109 + 7. Ex..
JPA를 사용할 때 Entity의 필드가 Enum인 경우, 실제 코딩시에는 Enum의 Constant를 사용하지만 DB에 저장할 땐 문자열 또는 정수로 된 코드를 저장하는 경우가 있을 수 있습니다. 이럴 때 커스텀 Converter를 만들어 AttributeConverter를 구현하여 해결하곤합니다. 그리고 JSON을 객체로 매핑할 때 해당 객체에 Enum이 포함된 경우에도 마찬가지로 비슷한 작업을 해줘야 합니다. 이 때 자주 사용되는 static 필드와 메서드가 있는데요, 예시를 하나 들어보자면, package io.lcalmsky.blogexamples.domain.entity.support; import com.fasterxml.jackson.annotation.JsonCreator; import ..
로컬 환경에서 데이터 베이스를 설정할 때 H2 Database를 많이 사용하고 특히 메모리 기반으로 동작시키는 상황이 자주 발생합니다. IntelliJ IDEA 에서 Database 탭을 활용하면 따로 접속 툴을 이용할 필요가 없어 굉장히 편리합니다. 보통 로컬에 MySQL Workbench나 H2 Database를 따로 설치해서 실행시킨 뒤 Database 탭 내에서 DataSource를 추가하여 로컬DB와 연동하는 방식을 많이 사용하는데요, 오늘 소개할 방법은 로컬에 따로 Database를 띄우지 않고 메모리 기반의 DataSource를 추가하는 방법입니다. 결과물을 보여드리기 위해 스프링 부트 프로젝트를 만들어 작성하였습니다. 설정하는 방법만 필요하신 분은 여기 참고하시면 됩니다. 소스 코드는 여기..
- Total
- Today
- Yesterday
- 함께 자라기
- 스프링 부트 회원 가입
- 헥사고날 아키텍처
- JPA
- 스프링 데이터 jpa
- Linux
- 클린 아키텍처
- Jackson
- leetcode
- 스프링 부트 애플리케이션
- Spring Data JPA
- spring boot app
- intellij
- proto3
- @ManyToOne
- 함께 자라기 후기
- Spring Boot
- r
- JSON
- spring boot application
- Spring Boot JPA
- 스프링 부트 튜토리얼
- 알고리즘
- 스프링부트
- gRPC
- Spring Boot Tutorial
- QueryDSL
- Java
- spring boot jwt
- 스프링 부트
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |