분류 전체보기
-
1. Two Sum 공간복잡도 O(1)로 풀어보자..TIL 2023. 12. 13. 23:51
https://leetcode.com/problems/two-sum/description/ Two Sum - LeetCode Can you solve this real interview question? Two Sum - Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not leetcode.com 주어진 문제를 풀면서 추가적인 리스트를 생성하지 않고, 입력된 nums 배열을 직접 사용하는 방법을 사용..
-
리트코드 - 1137. N-th Tribonacci Number코딩테스트 2023. 12. 13. 22:43
https://leetcode.com/problems/n-th-tribonacci-number/ N-th Tribonacci Number - LeetCode Can you solve this real interview question? N-th Tribonacci Number - The Tribonacci sequence Tn is defined as follows: T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0. Given n, return the value of Tn. Example 1: Input: n = 4 Output: 4 E leetcode.com 트리보나치 수열 Tn이 다음과 같을 때: n >= 0일 때 T0 = 0, T1 =..
-
리트코드 - 283. Move Zeroes코딩테스트 2023. 12. 11. 23:49
https://leetcode.com/problems/move-zeroes/description/ Move Zeroes - LeetCode Can you solve this real interview question? Move Zeroes - Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array. E leetcode.com 이 문제의 목표는 주어진 배열에서 모든 0을 배열의 끝으로 이동시키면서, 0이 아닌 요소들의 상..
-
리트코드 - 151. Reverse Words in a String코딩테스트 2023. 12. 11. 01:03
https://leetcode.com/problems/reverse-words-in-a-string/description/?envType=study-plan-v2&envId=leetcode-75 Reverse Words in a String - LeetCode Can you solve this real interview question? Reverse Words in a String - Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space. Return a s..
-
리트코드 - 345. Reverse Vowels of a String코딩테스트 2023. 12. 10. 18:06
https://leetcode.com/problems/reverse-vowels-of-a-string/description/ Reverse Vowels of a String - LeetCode Can you solve this real interview question? Reverse Vowels of a String - Given a string s, reverse only all the vowels in the string and return it. The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than onc leetcode.com 문자열 s가 주어지면 문자열의 모든 ..
-
리트코드 - 605. Can Place Flowers코딩테스트 2023. 12. 10. 03:59
https://leetcode.com/problems/can-place-flowers/description/ Can Place Flowers - LeetCode Can you solve this real interview question? Can Place Flowers - You have a long flowerbed in which some of the plots are planted, and some are not. However, flowers cannot be planted in adjacent plots. Given an integer array flowerbed containing 0's and 1' leetcode.com 빈 plot을 찾아 꽃을 심을 수 있는지 확인한다. 이를 위해 현재 ..
-
리트코드 - 1431. Kids With the Greatest Number of Candies코딩테스트 2023. 12. 10. 02:09
https://leetcode.com/problems/kids-with-the-greatest-number-of-candies/ Kids With the Greatest Number of Candies - LeetCode Can you solve this real interview question? Kids With the Greatest Number of Candies - There are n kids with candies. You are given an integer array candies, where each candies[i] represents the number of candies the ith kid has, and an integer extraCandie leetcode.com 쉬운 문..
-
리트코드 - 1071. Greatest Common Divisor of Strings코딩테스트 2023. 12. 10. 00:43
https://leetcode.com/problems/greatest-common-divisor-of-strings/ Greatest Common Divisor of Strings - LeetCode Can you solve this real interview question? Greatest Common Divisor of Strings - For two strings s and t, we say "t divides s" if and only if s = t + ... + t (i.e., t is concatenated with itself one or more times). Given two strings str1 and str2, return t leetcode.com 해당 문제는 두 개의 문자열이..