본문 바로가기
반응형

Study86

[LeetCode] #739. Daily Temperatures (python) 문제 https://leetcode.com/problems/daily-temperatures/ Daily Temperatures - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 온도 리스트가 주어진다. 해당 온도보다 더 따뜻해질때까지 기다려야 하는 날짜를 리스트로 반환하고 따뜻해지지 않으면 0으로 반환한다. 예시 입출력 Input: temperatures = [73,74,75,71,69,72,76,73] Output: [1,1,4,2,1,1,0,0] 풀이 책 .. 2022. 2. 24.
[LeetCode] #316. Remove Duplicate Letters (python) 문제 https://leetcode.com/problems/remove-duplicate-letters/ Remove Duplicate Letters - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 중복된 문자를 제거하는데 출력 결과는 사전식 순서로 가장 작은 결과를 출력해야 한다. 대신 주어진 문자열에 있는 알파벳들은 한번씩 나와야 한다. 예시 입출력 Input: s = "bcabc" Output: "abc" 풀이 책 풀이 1. 재귀 class Solutio.. 2022. 2. 24.
[LeetCode] #20. Valid Parentheses (python) 문제 https://leetcode.com/problems/valid-parentheses/ Valid Parentheses - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 괄호가 유효한지 확인하는 문제다. 괄호가 같은 종류로 잘 닫혔는지 확인하면 된다. 예시 입출력 Input: s = "()[]{}" Output: true 풀이 내 풀이 class Solution: def isValid(self, s: str) -> bool: stack=[] start=['.. 2022. 2. 24.
[LeetCode] #21. Merge Two Sorted Lists (python) 문제 https://leetcode.com/problems/merge-two-sorted-lists/ Merge Two Sorted Lists - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 주어진 두 연결 리스트를 하나의 정렬된 연결 리스트로 반환해야 한다. 예시 입출력 Input: list1 = [1,2,4], list2 = [1,3,4] Output: [1,1,2,3,4,4] 풀이 책 풀이 재귀 구조 class Solution: def mergeTwoLi.. 2022. 2. 21.
반응형