본문 바로가기

LeetCode easy19

[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] 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.
[LeetCode] 83. Remove Duplicates from Sorted List 풀이 (JS) 0. 문제 https://leetcode.com/problems/remove-duplicates-from-sorted-list/ Remove Duplicates from Sorted 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 정렬된 연결 목록이 주어지면 각 요소가 한 번만 나타나도록 모든 중복 항목을 삭제합니다. #1 Input: head = [1,1,2] Output: [1,2] #2 Input: head = [1,1,2,3,3] Output:.. 2022. 7. 24.