본문 바로가기

코딩 테스트14

240306 LeetCode 문제 풀이 141. Linked List Cycle https://leetcode.com/problems/linked-list-cycle/description/?envType=daily-question&envId=2024-03-06 1) 문제 설명 Given head, the head of a linked list, determine if the linked list has a cycle in it. There is a cycle in a linked list if there is some node in the list that can be reached again by continuously following the next pointer. Internally, pos is used to denote the in.. 2024. 3. 6.
231209 LeetCode 문제 풀이 606. Construct String from Binary Tree https://leetcode.com/problems/construct-string-from-binary-tree/?envType=daily-question&envId=2023-12-08 1) 문제 설명 Given the root of a binary tree, construct a string consisting of parenthesis and integers from a binary tree with the preorder traversal way, and return it. Omit all the empty parenthesis pairs that do not affect the one-to-one mapping relation.. 2023. 12. 9.
231201 LeetCode 문제 풀이 1662. Check If Two String Arrays are Equivalent https://leetcode.com/problems/check-if-two-string-arrays-are-equivalent/description/?envType=daily-question&envId=2023-12-01 1) 문제 설명 Given two string arrays word1 and word2, return true if the two arrays represent the same string, and false otherwise. A string is represented by an array if the array elements concatenated in order forms the string... 2023. 12. 1.
231110 LeetCode 문제 풀이 (그래프, 인접 행렬) 1743. Restore the Array From Adjacent Pairs https://leetcode.com/problems/restore-the-array-from-adjacent-pairs/?envType=daily-question&envId=2023-11-10 1) 문제 설명 There is an integer array nums that consists of n unique elements, but you have forgotten it. However, you do remember every pair of adjacent elements in nums. You are given a 2D integer array adjacentPairs of size n - 1 where each adja.. 2023. 11. 10.
231023 LeetCode 문제 풀이 342. Power of Four https://leetcode.com/problems/power-of-four/?envType=daily-question&envId=2023-10-23 1) 문제 설명 Given an integer n, return true if it is a power of four. Otherwise, return false. An integer n is a power of four, if there exists an integer x such that n == 4x. 2) 제한 사항 -231 2023. 10. 23.
231022 LeetCode 문제 풀이 1793. Maximum Score of a Good Subarray https://leetcode.com/problems/maximum-score-of-a-good-subarray/?envType=daily-question&envId=2023-10-22 1) 문제 설명 You are given an array of integers nums (0-indexed) and an integer k. The score of a subarray (i, j) is defined as min(nums[i], nums[i+1], ..., nums[j]) * (j - i + 1). A good subarray is a subarray where i 2023. 10. 23.