본문 바로가기
반응형

Study86

[LeetCode] #234. Palindrome Linked List (python) 문제 https://leetcode.com/problems/palindrome-linked-list/ Palindrome Linked List - 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: head = [1,2,2,1] Output: true 풀이 내 풀이 class Solution: def isPalindrome(self, head: Optional[ListNode]) -> bo.. 2022. 2. 21.
[LeetCode] #1. Two Sum (python) 문제 https://leetcode.com/problems/two-sum/ Two Sum - 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 주어진 숫자 리스트에서 더하면 target 값이 되는 두 수의 인덱스 값을 리스트로 반환해야 하는 문제다. 예시 입출력 Input: nums = [2,7,11,15], target = 9 Output: [0,1] 풀이 내 풀이 class Solution: def twoSum(self, nums: List[int], targe.. 2022. 2. 21.
[LeetCode] #5. Longest Palindromic Substring (python) 문제 https://leetcode.com/problems/longest-palindromic-substring/ Longest Palindromic Substring - 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 = "babad" Output: "bab" 풀이 책 풀이 class Solution: def longestPalindrome(self, s: str) -> s.. 2022. 2. 21.
[LeetCode] #49. Group Anagrams (python) 문제 https://leetcode.com/problems/group-anagrams/ Group Anagrams - 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: strs = ["eat","tea","tan","ate","nat","bat"] Output: [["bat"],["nat","tan"],["ate","eat",".. 2022. 2. 20.
반응형