본문 바로가기

LeetCode easy19

[LeetCode] 26. Remove Duplicates from Sorted Array 풀이 (JS) 0. 문제 https://leetcode.com/problems/remove-duplicates-from-sorted-array/ Remove Duplicates from 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: nums = [1,1,2] Output: 2, nums = [1,2,_] Explanation: Your functi.. 2022. 7. 17.
[LeetCode] 21. Merge Two Sorted Lists 풀이 (JS) 0. 문제 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 두 개의 정렬된 정수 리스트를 입력받아, 두 리스트를 이용하여 하나의 정렬된 리스트 #1 Input: list1 = [1,2,4], list2 = [1,3,4] Output: [1,1,2,3,4,4] #2 Input: list1 = [], list2 = [] Outp.. 2022. 7. 17.
[LeetCode] 20. Valid Parentheses 풀이 (JS) 0. 문제 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 주어진 문자열에서 에서 괄호가 순서대로 닫혔는지 여부를 확인하여 반환하는 문제 #1 Input: s = "()" Output: true #2 Input: s = "()[]{}" Output: true #3 Input: s = "(]" Output: false 1.언어 자바스크립트(Ja.. 2022. 7. 17.
[LeetCode] 14. Longest Common Prefix 풀이 0. 문제 https://leetcode.com/problems/longest-common-prefix/submissions/ Longest Common Prefix - 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: strs = ["flower","flow","flight"] Output: "fl" #2 Input: strs = ["d.. 2022. 7. 10.