소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given the root of a binary tree, invert the tree, and return its root. Example 1: Input: root = [4,2,7,1,3,6,9] Output: [4,7,2,9,6,3,1] Example 2: Input: root = [2,1,3] Output: [2,3,1] Example 3: Input: root = [] Output: [] Constraints: The number of nodes in the tree is in the range [0, 100]. -100
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given the root of a complete binary tree, return the number of the nodes in the tree. According to Wikipedia, every level, except possibly the last, is completely filled in a complete binary tree, and all nodes in the last level are as far left as possible. It can have between 1 and 2h nodes inclusive at the last level h. Design an algorithm that runs in less..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem The next greater element of some element x in an array is the first greater element that is to the right of x in the same array. You are given two distinct 0-indexed integer arrays nums1 and nums2, where nums1 is a subset of nums2. For each 0
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given the root of a binary tree with unique values and the values of two different nodes of the tree x and y, return true if the nodes corresponding to the values x and y in the tree are cousins, or false otherwise. Two nodes of a binary tree are cousins if they have the same depth with different parents. Note that in a binary tree, the root node is at the de..
본 포스팅은 백기선님의 스프링과 JPA 기반 웹 애플리케이션 개발 강의를 참고하여 작성하였습니다. 소스 코드는 여기 있습니다. (branch: feature/9) ⚠ Warning: 기존에 프로젝트 생성시 의도했던 것은 multi module 프로젝트를 구성하는 것이었는데 굳이 그렇게 할 필요성을 느끼지 못해 사용하던 패키지명을 수정하였습니다. 이전 포스팅을 따라서 작성하시던 분들이 계시다면 이 점 유의해주시기 바랍니다. Overview 회원 가입 완료(이메일 인증 완료)시 자동 로그인처리가 되도록 합니다. [Spring Security 내에서 로그인을 다루는 방법] SecurityContext - Authentication(Token) UsernamePasswordAuthenticationToken [..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem You are given an array prices where prices[i] is the price of a given stock on the ith day. Find the maximum profit you can achieve. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times) with the following restrictions: After you sell your stock, you cannot buy stock on the next day (i.e., cooldown on..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given an integer n, return the least number of perfect square numbers that sum to n. A perfect square is an integer that is the square of an integer; in other words, it is the product of some integer with itself. For example, 1, 4, 9, and 16 are perfect squares while 3 and 11 are not. Example 1: Input: n = 12 Output: 3 Explanation: 12 = 4 + 4 + 4. Example 2: ..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given an array of integers preorder, which represents the preorder traversal of a BST (i.e., binary search tree), construct the tree and return its root. It is guaranteed that there is always possible to find a binary search tree with the given requirements for the given test cases. A binary search tree is a binary tree where for every node, any descendant of..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given the root of a binary tree, return the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path between any two nodes in a tree. This path may or may not pass through the root. The length of a path between two nodes is represented by the number of edges between them. Example 1: Input: root = [1,2,3,4,5] Output: ..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given two integers left and right that represent the range [left, right], return the bitwise AND of all numbers in this range, inclusive. Example 1: Input: left = 5, right = 7 Output: 4 Example 2: Input: left = 0, right = 0 Output: 0 Example 3: Input: left = 1, right = 2147483647 Output: 0 Constraints: 0 >= 1; move++; } return right test(5, 7, 4), () -> test(..
본 포스팅은 백기선님의 스프링과 JPA 기반 웹 애플리케이션 개발 강의를 참고하여 작성하였습니다. 소스 코드는 여기 있습니다. (branch: feature/8) Overview 회원 가입시 전송한 이메일을 확인하여 회원을 인증하는 절차를 개발합니다. 회원 가입시 다시 서버로 요청할 수 있게 토큰을 포함한 링크를 전송하고 사용자가 해당 링크를 클릭했을 때 토큰이 일치하면 가입 완료 처리합니다. 이메일 인증을 하는 이유는 무작위로 생성하는 이메일 계정을 허용하지 않기 위함이고, 서비스 내에서의 메일 전송 기능을 제대로 활용할 수 없기 때문입니다. 이메일 인증을 대체할 수 있는 방법은 소셜 인증 등이 있습니다. 인증 링크로 접근했을 때 노출될 화면과 인증 로직을 개발해야 합니다. 이메일 인증 개발 입력 값에..
본 포스팅은 백기선님의 스프링과 JPA 기반 웹 애플리케이션 개발 강의를 참고하여 작성하였습니다. 소스 코드는 여기 있습니다. (branch: feature/7) Overview 비밀번호를 평문 그대로 저장하는 서비스는 세상 어디에도 없습니다. 특히 전자금융권과 같이 민감한 개인 정보를 다루는 쪽에서는 망을 분리해여 저장하고 접근하기도 합니다. 마찬가지로 지금 개발하는 서비스에도 비밀번호 인코딩 기능을 추가해줘야 합니다. Implementation 스프링 시큐리티에서 권장하는 방법은 PasswordEncoder를 사용하는 것입니다. 사용 방법은 매우 간단합니다. PasswordEncoder를 빈 등록해주면 되는데 직접 사용할 알고리즘을 구현해도 되고 기본값을 사용해도 됩니다. 기본값을 사용할 경우 BCr..
본 포스팅은 백기선님의 스프링과 JPA 기반 웹 애플리케이션 개발 강의를 참고하여 작성하였습니다. 소스 코드는 여기 있습니다. (branch: feature/6) Overview 지금까지 작성한 코드를 리펙터링합니다. 리펙터링 전에 테스트 코드를 작성하면 리펙터링 이후에도 견고한 테스트 코드를 작성했는지 추가로 확인할 수 있습니다. 테스트 할 것을 정의합니다. 회원 가입시 이상한 값이 입력된 경우 다시 회원 가입 화면으로 리다이렉트 하는지 확인 에러가 잘 노출 되는지 확인 회원 가입시 정상적인 값이 입력된 경우 가입한 회원 데이터가 존재하는지 확인 이메일이 보내지는지 확인 리팩터링시 고려해야할 부분입니다. 메서드의 길이 너무 길면 메서드를 나눔 코드 가독성 코드의 위치 객체들 사이의 의존 관계 클래스의 ..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem A trie (pronounced as "try") or prefix tree is a tree data structure used to efficiently store and retrieve keys in a dataset of strings. There are various applications of this data structure, such as autocomplete and spellchecker. Implement the Trie class: Trie() Initializes the trie object. void insert(String word) Inserts the string word into the trie. boo..
소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given an m x n grid of characters board and a string word, return true if word exists in the grid. The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once. Example 1: Input: board = [["A","B","C","E"],["S","F","C","S"],["A","D"..
- Total
- Today
- Yesterday
- QueryDSL
- Java
- Linux
- 헥사고날 아키텍처
- gRPC
- 함께 자라기
- Jackson
- proto3
- 스프링 부트 회원 가입
- 함께 자라기 후기
- JPA
- 알고리즘
- @ManyToOne
- intellij
- r
- Spring Boot
- 스프링 부트
- Spring Boot JPA
- Spring Data JPA
- JSON
- 스프링 부트 튜토리얼
- 스프링 부트 애플리케이션
- 스프링 데이터 jpa
- 스프링부트
- spring boot app
- spring boot application
- leetcode
- 클린 아키텍처
- spring boot jwt
- Spring Boot Tutorial
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |