본문 바로가기
반응형

전체 글167

[LeetCode 해석 및 풀이] 143. Reorder List LeetCode 문제 해석 및 풀이 방법 문제 143. Reorder List(재정렬한 리스트) 바로가기 문제 설명 영문 You are given the head of a singly linked-list. The list can be represented as: L0 → L1 → … → Ln - 1 → Ln Reorder the list to be on the following form: L0 → Ln → L1 → Ln - 1 → L2 → Ln - 2 → … You may not modify the values in the list's nodes. Only nodes themselves may be changed. 한글 단일 연결 리스트의 head가 주어집니다. 리스트는 아래와 같이 나타내집니다 L0 .. 2024. 4. 20.
[LeetCode 해석 및 풀이] 21. Merge Two Sorted Lists LeetCode 문제 해석 및 풀이 방법 문제 21. Merge Two Sorted Lists(두개의 정렬된 연결리스트 합병)바로가기 문제 설명영문You are given the heads of two sorted linked lists list1 and list2. Merge the two lists into one sorted list. The list should be made by splicing together the nodes of the first two lists. Return the head of the merged linked list. 한글두 개의 정렬된 연결리스트의 머리인 list1, list2가 주어집니다. 두 개의 리스트를 하나의 정렬된 리스트로 합치십시오. 리스트는 두 리스트의.. 2024. 4. 19.
[LeetCode 해석 및 풀이] 206. Reverse Linked List LeetCode 문제 해석 및 풀이 방법 문제 206. Reverse Linked List(연결 리스트 역전) 바로가기 문제 설명 영문 Given the head of a singly linked list, reverse the list, and return the reversed list. 한글 단일 연결 리스트의 head가 주어지면, 리스트를 역전하고 역전된 리스트를 반환하십시 제한조건 The number of nodes in the list is the range [0, 5000]. -5000 Optional[ListNode]: if not head: return None else: new_head = head if head.next: new_head = self.reverseList(head.ne.. 2024. 4. 19.
[LeetCode 해석 및 풀이] 11. Container With Most Water LeetCode 문제 해석 및 풀이 방법 문제 11. Container With Most Water(가장 많은 물을 담는 용기) 바로가기 문제 설명 영문 You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]). Find two lines that together with the x-axis form a container, such that the container contains the most water. Return the maximum amount of water a cont.. 2024. 4. 17.
[LeetCode 해석 및 풀이] 853. Car Fleet LeetCode 문제 해석 및 풀이 방법 문제 853. Car Fleet(자동차 함대) 바로가기 문제 설명 영문 There are n cars going to the same destination along a one-lane road. The destination is target miles away. You are given two integer array position and speed, both of length n, where position[i] is the position of the ith car and speed[i] is the speed of the ith car (in miles per hour). A car can never pass another car ahead of it, .. 2024. 4. 17.
[LeetCode 해석 및 풀이] 739. Daily Temperatures LeetCode 문제 해석 및 풀이 방법 문제 739. Daily Temperatures(일일 기온) 바로가기 문제 설명 영문 Given an array of integers temperatures represents the daily temperatures, return an array answer such that answer[i] is the number of days you have to wait after the ith day to get a warmer temperature. If there is no future day for which this is possible, keep answer[i] == 0 instead. 한글 일일 기온을 나타내는 정수 배열 temperatures가 주어지면,.. 2024. 4. 17.
반응형