본문 바로가기

LeetCode/코딩 테스트 스터디 3주차9

[LeetCode] 101. Symmetric Tree 풀이 (JS) 0. 문제 https://leetcode.com/problems/symmetric-tree/ Symmetric Tree - 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 입력값 이진 트리가 주어지면 그것이 자신의 거울인지 (즉, 중심을 중심으로 대칭인지) 확인하는 문제 1.언어 자바스크립트(JavaScript) 2. 문제 풀이 var isSymmetric = function(root) { return isSameTree(root, root); }; functio.. 2022. 7. 24.
[LeetCode] 100. Same Tree 풀이 (JS) 0. 문제 https://leetcode.com/problems/same-tree/submissions/ Same Tree - 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 입력값 두 이진 트리가 구조적으로 동일하고 노드가 동일한 값을 갖는 경우 true를 출력 아닐 경우 false를 출력한다. 두 개의 이진 트리가 구조적으로 동일하고 노드가 동일한 값을 갖는 경우 동일한 것으로 간주된다. #1 Input: p = [1,2,3], q = [1,2,3] Outpu.. 2022. 7. 24.
[LeetCode] 15. 3Sum 풀이 (JS) 0. 문제 https://leetcode.com/problems/3sum/ 3Sum - 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이 되는 세개의 원소를 배열로 리턴 #1 Input: nums = [-1,0,1,2,-1,-4] Output: [[-1,-1,2],[-1,0,1]] Explanation: nums[0] + nums[1] + nums[2] = (-1) + 0 + 1 = 0. nums[1] + nums[2.. 2022. 7. 24.
[LeetCode] 88. Merge Sorted Array 풀이 (JS) 0. 문제 https://leetcode.com/problems/merge-sorted-array/ Merge Sorted Array - 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 정렬된 두개의 배열을 합쳐서 하나의 정렬된 배열을 만드는 문제 #1 Input: nums1 = [1,2,3,0,0,0], m = 3, nums2 = [2,5,6], n = 3 Output: [1,2,2,3,5,6] Explanation: The arrays we are mergin.. 2022. 7. 24.