본문 바로가기

LeetCode27

[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.
[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.