본문 바로가기

LeetCode/코딩 테스트 스터디 2주차12

[LeetCode] 35. Search Insert Position 풀이 (JS) 0. 문제 https://leetcode.com/problems/search-insert-position/ Search Insert Position - 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,3,5,6], target = 5 Output: 2 #2 Input: nums = [1,3,5,6], target = 2 Output: 1 #3 Input: num.. 2022. 7. 17.
[LeetCode] 28. Implement strStr() 풀이 (JS) 0. 문제 https://leetcode.com/problems/implement-strstr/ Implement strStr() - 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: haystack = "hello", needle = "ll" Output: 2 #2 Input: haystack = "aaaaa", needle = "bba" Output: -.. 2022. 7. 17.
[LeetCode] 6. Zigzag Conversion 풀이 (JS) 0. 문제 https://leetcode.com/problems/zigzag-conversion/ Zigzag Conversion - 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 문자열 "PAYPALISHIRING" 은 다음과 같이 주어진 행 수에 지그재그 패턴으로 작성된다. P A H N A P L S I I G Y I R "PAHNAPLSIIGYIR" 을 한 줄씩 읽고 문자열로 반환하는 문제. #1 Input: s = "PAYPALISHIRING", num.. 2022. 7. 17.
[LeetCode] 27. Remove Element 풀이 (JS) 0. 문제 https://leetcode.com/problems/remove-element/ Remove Element - 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 = [3,2,2,3], val = 3 Output: 2, nums = [2,2,_,_] Explanation: Your function should return k = 2, with t.. 2022. 7. 17.