본문 바로가기

분류 전체보기33

[LeetCode] 58. Length of Last Word 풀이 (JS) 0. 문제 https://leetcode.com/problems/length-of-last-word/ Length of Last Word - 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 s단어와 공백으로 구성된 문자열이 주어지면 문자열 의 마지막 단어 길이를 반환 #1 Input: s = "Hello World" Output: 5 #2 Input: s = " fly me to the moon " Output: 4 #3 Input: s = "luffy is st.. 2022. 7. 17.
[LeetCode] 7. Reverse Integer 풀이 (JS) 0. 문제 https://leetcode.com/problems/reverse-integer/ Reverse Integer - 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 부호 있는 32비트 정수가 주어지면 숫자를 반전하여 반환 #1 Input: x = 123 Output: 321 #2 Input: x = -123 Output: -321 #3 Input: x = 120 Output: 21 1.언어 자바스크립트(JavaScript) 2. 문제 풀이 var rev.. 2022. 7. 17.
[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.