본문 바로가기
반응형

🖥️ 문제 풀이111

[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.
[LeetCode 해석 및 풀이] 22. Generate Parentheses LeetCode 문제 해석 및 풀이 방법 문제22. Generate Parentheses(괄호 생성) 바로가기 문제 설명 영문 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. 한글 n쌍의 괄호가 주어지면, 모든 조합의 잘 만들어진 괄호형태를 생성하는 함수를 작성하시오. 제한조건 1 List[str]: if count == 0 == stack: return [state] result = [] if count > 0: result += get_next(state+'(', count-1, stack+1) if stack > 0: result += get_next(state+.. 2024. 4. 16.
[LeetCode 해석 및 풀이] 150. Evaluate Reverse Polish Notation LeetCode 문제 해석 및 풀이 방법 문제 150. Evaluate Reverse Polish Notation(역폴란드 표기법 계산) 바로가기 문제 설명 영문 You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation. Evaluate the expression. Return an integer that represents the value of the expression. Note that: The valid operators are '+', '-', '*', and '/'. Each operand may be an integer or another expres.. 2024. 4. 16.
반응형