전체 글 422

[Two Pointers][Easy] 392. Is Subsequence

https://leetcode.com/problems/is-subsequence Is Subsequence - LeetCode Can you solve this real interview question? Is Subsequence - Given two strings s and t, return true if s is a subsequence of t, or false otherwise. A subsequence of a string is a new string that is formed from the original string by deleting some (can be n leetcode.com Q. 입력문자 t의 일부만 제거하되, 순서 변경없이 입력문자 s를 구성할수 있는지 여부를 반환하라. S..

Leetcode/LeetCode75 2023.12.01

[Two Pointers][Easy] 283. Move Zeroes

https://leetcode.com/problems/move-zeroes 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 Q. 배열에 등장하는 0을 모두 뒤로 옮기도록 배열을 재 구성하라. 우선 직관적으로 0이 등장하면, 뒤로 옮기고, 0이..

Leetcode/LeetCode75 2023.11.30

[Array/String][Medium] 443. String Compression

https://leetcode.com/problems/string-compression String Compression - LeetCode Can you solve this real interview question? String Compression - Given an array of characters chars, compress it using the following algorithm: Begin with an empty string s. For each group of consecutive repeating characters in chars: * If the group's leng leetcode.com Q. 입력캐릭터를 다음과 같은 조건에 기반하여 압축하라. - 문자를 출력하고 다음에 해당..

Leetcode/LeetCode75 2023.11.29

[Array/String][Medium] 334. Increasing Triplet Subsequence

https://leetcode.com/problems/increasing-triplet-subsequence Increasing Triplet Subsequence - LeetCode Can you solve this real interview question? Increasing Triplet Subsequence - Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i < j < k and nums[i] < nums[j] < nums[k]. If no such indices exists, return false leetcode.com Q. 증가하는 3개의 index와 그 값이 오..

Leetcode/LeetCode75 2023.11.28

[Array/String][Medium] 238. Product of Array Except Self

https://leetcode.com/problems/product-of-array-except-self Product of Array Except Self - LeetCode Can you solve this real interview question? Product of Array Except Self - Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the elements of nums except nums[i]. The product of any prefix or suffix of nu leetcode.com Q. 입력 array nums가 있을때, 이 arra..

Leetcode/Challenges 2023.11.27

[Array][String] [Medium] 151. Reverse Words in a String

https://leetcode.com/problems/reverse-words-in-a-string 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 strin leetcode.com Q. s는 space와 space가 아닌 문자, 즉 단어들의 집..

Leetcode/LeetCode75 2023.11.26

[Array/String][Easy] 345. Reverse Vowels of a String

https://leetcode.com/problems/reverse-vowels-of-a-string 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 Q. input string s를 입력으로 받을때, 모음문자..

Leetcode/LeetCode75 2023.11.26

[Array/String][Easy] 605. Can Place Flowers

https://leetcode.com/problems/can-place-flowers 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 Q. 각 자리가 1일때 flow가 planted되어 있고, 0이면 그렇지 않다. flower..

Leetcode/LeetCode75 2023.11.25

[Array/String][Easy] 1431. Kids With the Greatest Number of Candies

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 Q. 배열..

Leetcode/LeetCode75 2023.11.25

[Array/String][Easy] 1768. Merge Strings Alternately

Q. word1과 word2를 하나 씩 merge하라. 문제 그대로 연산하여 merge하면 됨. string mergeAlternately(string word1, string word2) { int p1 = 0, p2 = 0; string ret = ""; while (p1 < word1.length() || p2 < word2.length()) { if (p1 < word1.length()) ret += word1.at(p1++); if (p2 < word2.length()) ret += word2.at(p2++); } return ret; } Key : 사고과정을 플밍 구현으로 실현 여부 테스팅. Comment : 그냥 프로그램 단순 능력 테스팅.... 리트코드에 잘 없는 함정없이 쉬운 문제.

Leetcode/LeetCode75 2023.11.24