본문 바로가기 메뉴 바로가기

Jaime's 기술 블로그

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Jaime's 기술 블로그

검색하기 폼
  • All (492)
    • IntelliJ IDEA (8)
    • SpringBoot (83)
      • Web Application 만들기 (71)
      • JWT 튜토리얼 (5)
    • Java (19)
    • JPA (33)
    • Querydsl (14)
    • gRPC (10)
    • macOS (7)
    • Docker (1)
    • Linux (5)
    • R (5)
    • Test (3)
    • ETC (13)
    • Algorithm (265)
      • LeetCode (258)
    • Retrospect (4)
    • git (1)
    • Architecture (8)
    • Book (10)
      • 함께 자라기 (7)
      • 프로그래머의 뇌 (3)
    • Essay (1)
  • 방명록

전체 글 (492)
[LeetCode] 152. Maximum Product Subarray

소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given an integer array nums, find a subarray that has the largest product, and return the product. The test cases are generated so that the answer will fit in a 32-bit integer. Example 1: Input: nums = [2,3,-2,4] Output: 6 Explanation: [2,3] has the largest product 6. Example 2: Input: nums = [-2,0,-1] Output: 0 Explanation: The result cannot be 2, because [-..

Algorithm/LeetCode 2023. 7. 5. 02:21
[LeetCode] 72. Edit Distance

소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given two strings word1 and word2, return the minimum number of operations required to convert word1 to word2. You have the following three operations permitted on a word: Insert a character Delete a character Replace a character Example 1: Input: word1 = "horse", word2 = "ros" Output: 3 Explanation: horse -> rorse (replace 'h' with 'r') rorse -> rose (remove..

Algorithm/LeetCode 2023. 7. 4. 03:54
[LeetCode] 146. LRU Cache

소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Design a data structure that follows the constraints of a Least Recently Used (LRU) cache. Implement the LRUCache class: LRUCache(int capacity) Initialize the LRU cache with positive size capacity. int get(int key) Return the value of the key if the key exists, otherwise return -1. void put(int key, int value) Update the value of the key if the key exists. Ot..

Algorithm/LeetCode 2023. 7. 3. 03:24
[LeetCode] 78. Subsets

소스 코드는 여f기 있습니다. 문제는 여기 있습니다. Problem Given an integer array nums of unique elements, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order. Example 1: Input: nums = [1,2,3] Output: [[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]] Example 2: Input: nums = [0] Output: [[],[0]] Constraints: 1

Algorithm/LeetCode 2023. 7. 2. 03:57
[LeetCode] 240. Search a 2D Matrix II

소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Write an efficient algorithm that searches for a value target in an m x n integer matrix matrix. This matrix has the following properties: Integers in each row are sorted from left to right. The first integer of each row is greater than the last integer of the previous row. Example 1: Input: matrix = [[1,3,5,7],[10,11,16,20],[23,30,34,60]], target = 3 Output:..

Algorithm/LeetCode 2023. 7. 1. 03:56
[LeetCode] 46. Permutations

소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given an array nums of distinct integers, return all the possible permutations. You can return the answer in any order. Example 1: Input: nums = [1,2,3] Output: [[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]] Example 2: Input: nums = [0,1] Output: [[0,1],[1,0]] Example 3: Input: nums = [1] Output: [[1]] Constraints: 1

Algorithm/LeetCode 2023. 6. 30. 03:54
[LeetCode] 230. Kth Smallest Element in a BST

소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree. Example 1: Input: root = [3,1,4,null,2], k = 1 Output: 1 Example 2: Input: root = [5,3,6,2,4,null,null,1], k = 3 Output: 3 Constraints: The number of nodes in the tree is n. 1

Algorithm/LeetCode 2023. 6. 29. 23:23
[LeetCode] 334. Increasing Triplet Subsequence

소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i < j < k and nums[i] < nums[j] < nums[k]. If no such indices exists, return false. Example 1: Input: nums = [1,2,3,4,5] Output: true Explanation: Any triplet where i < j < k is valid. Example 2: Input: nums = [5,4,3,2,1] Output: false Explanation: No triplet exis..

Algorithm/LeetCode 2023. 6. 28. 22:53
[LeetCode] 328. Odd Even Linked List

소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given the head of a singly linked list, group all the nodes with odd indices together followed by the nodes with even indices, and return the reordered list. The first node is considered odd, and the second node is even, and so on. Note that the relative order inside both the even and odd groups should remain as it was in the input. You must solve the problem..

Algorithm/LeetCode 2023. 6. 27. 22:52
[LeetCode] 322. Coin Change

소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem You are given an integer array coins representing coins of different denominations and an integer amount representing a total amount of money. Return the fewest number of coins that you need to make up that amount. If that amount of money cannot be made up by any combination of the coins, return -1. You may assume that you have an infinite number of each kind..

Algorithm/LeetCode 2023. 6. 26. 21:18
[LeetCode] 1027. Longest Arithmetic Subsequence

소스 코드는 여기 있습니다. 문제는 여기 있습니다. Problem Given an array nums of integers, return the length of the longest arithmetic subsequence in nums. Note that: A subsequence is an array that can be derived from another array by deleting some or no elements without changing the order of the remaining elements. A sequence seq is arithmetic if seq[i + 1] - seq[i] are all the same value (for 0

Algorithm/LeetCode 2023. 6. 23. 23:18
소프트웨어 민담: 바닐라 아이스크림 알레르기가 있는 차

재밌는 글이 있어 공유합니다. 버그는 가끔 믿기 힘든 증상을 보일 때가 있습니다. 아래는 웹에서 수집한 이야기들을 시리즈로 번역해 공유할 예정입니다. 차가 바닐라 아이스크림 알레르기가 있어요 명백한 것이 항상 해결책은 아니며 사실이 아무리 믿을 수 없더라도 여전히 사실이라는 것을 이해하는 엔지니어를 위해... 제너럴 모터스의 폰티악 사업부에서 불만이 접수되었습니다. "이것은 저가 두 번째로 여러분에게 편지를 쓰는 것이고, 제가 미친 사람처럼 들릴 것 같아서 여러분이 답장하지 않는 것은 이해합니다만, 저희 가족은 저녁 식사 후에 매일 디저트로 아이스크림을 먹는 전통이 있습니다. 하지만 어떤 종류의 아이스크림을 먹을지는 매일 밤 우리 가족이 투표해서 결정하고, 저는 차를 타고 가게에 가서 아이스크림을 사오곤..

ETC 2023. 6. 2. 12:53
try-with-resources는 왜 유용할까? (부제: 바이트 코드를 까보자)

try-with-resources란? 자바에서 자원을 사용하는 블록을 처리할 때 자동으로 자원을 해제하는데 사용되는 구문으로 사용 방법은 아래와 같습니다. try (Resource resource = new Resource()) { // 자원 사용 코드 } catch (Exception e) { // 예외 처리 코드 } 이 때 try의 매개변수에서 선언할 수 있으려면 AutoClosable 인터페이스를 구현해야 합니다. 대부분의 자바 표준 라이브러리 클래스들은 AutoClosable 인터페이스를 구현하고 있습니다. 커스텀 클래스를 사용하려면 해당 클래스가 AutoClosable 인터페이스를 구현해야 합니다. AutoClosable 펼쳐 보기 /* * Copyright (c) 2009, 2013, Orac..

Java 2023. 5. 16. 05:09
[Java] PhantomReference를 활용해 가비지 컬렉션 리소스 해제 감지하기

PhantomReference란? PhantomReference는 Java의 Reference 클래스의 하위 클래스 중 하나로, Java 객체의 참조를 간접적으로 유지하면서 해당 객체가 가비지 컬렉션될 때 알림을 받을 수 있도록 해주는 클래스입니다. PhantomReference를 생성할 때는 해당 객체의 참조와 함께 ReferenceQueue를 함께 전달해야 합니다. 이렇게 생성된 PhantomReference는 객체의 참조를 간접적으로 유지하지만, 실제 객체를 참조하는 것은 아닙니다. 그러므로 해당 객체는 가비지 컬렉션 대상이 됩니다. PhantomReference가 알림을 받기 위해서는 해당 객체가 가비지 컬렉션될 때, PhantomReference가 참조하는 객체와 함께 ReferenceQueue..

Java 2023. 5. 11. 00:09
[Java] WeakReference와 Garbage Collector

WeakReference란? Java에서 WeakReference는 가비지 컬렉터에 의해 강제로 수집될 수 있는 참조를 나타내는 객체입니다. 일반적으로 Java에서는 객체에 대한 참조가 있는 경우 해당 객체는 메모리에서 수집되지 않습니다. 하지만 WeakReference는 약한 참조를 제공하여 객체가 메모리에서 수집되도록 허용합니다. WeakReference를 사용하면 객체가 더 이상 사용되지 않는 경우 자동으로 메모리에서 제거됩니다. 이는 객체의 수명 주기를 추적하고 메모리 누수를 방지하는 데 유용합니다. 예를 들어 캐시나 캐시 라인에 저장된 객체는 더 이상 필요하지 않을 때 메모리에서 제거되어야 합니다. 이때 WeakReference를 사용하면 캐시에서 제거되는 객체의 메모리를 즉시 회수할 수 있습니..

Java 2023. 5. 10. 01:38
이전 1 2 3 4 5 6 ··· 33 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
  • github
TAG
  • 스프링 부트 애플리케이션
  • Java
  • Spring Boot
  • JSON
  • 스프링 부트
  • leetcode
  • 헥사고날 아키텍처
  • JPA
  • Linux
  • 함께 자라기
  • @ManyToOne
  • Spring Data JPA
  • spring boot application
  • proto3
  • spring boot jwt
  • r
  • QueryDSL
  • 스프링 부트 회원 가입
  • spring boot app
  • gRPC
  • 스프링 부트 튜토리얼
  • 클린 아키텍처
  • 스프링 데이터 jpa
  • Spring Boot Tutorial
  • 알고리즘
  • 스프링부트
  • Jackson
  • Spring Boot JPA
  • intellij
  • 함께 자라기 후기
more
«   2025/05   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바