Algorithm (2139) 썸네일형 리스트형 (C++) - LeetCode (easy) 283. Move Zeroes https://leetcode.com/problems/move-zeroes/description/ Move Zeroes - LeetCode 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. Example 1: Input: nums = [0,1,0,3,12] Output: leetcode.com 구현 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 0인 마지막 index를 저장할 변수 zer.. (C++) - LeetCode (easy) 953. Verifying an Alien Dictionary https://leetcode.com/problems/verifying-an-alien-dictionary/description/ Verifying an Alien Dictionary - LeetCode Verifying an Alien Dictionary - In an alien language, surprisingly, they also use English lowercase letters, but possibly in a different order. The order of the alphabet is some permutation of lowercase letters. Given a sequence of words written in the ali leetcode.com 정렬 문제였습니다. 📕 풀.. (C++) - LeetCode (easy) 1072. Flip Columns For Maximum Number of Equal Rows https://leetcode.com/problems/greatest-common-divisor-of-strings/description/ Greatest Common Divisor of Strings - LeetCode 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 the largest string x such that x divides both leetcode.com 전수조사.. (C++) - LeetCode (easy) 278. First Bad Version https://leetcode.com/problems/first-bad-version/description/ First Bad Version - LeetCode First Bad Version - You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions leetcode.com 이분 탐색 문제였습니다. 📕 풀이방법 📔 풀이과정 처음으로 isBadV.. (C++) - LeetCode (easy) 1137. N-th Tribonacci Number https://leetcode.com/problems/n-th-tribonacci-number/description/ N-th Tribonacci Number - LeetCode 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 Explanation: T_3 = 0 + 1 + 1 = 2 T_4 = 1 + 1 leetcode.com dp 문제였습니다. 📕 풀이방법 📔 입력 및 초기화 생성자에 .. (C++) - LeetCode (easy) 268. Missing Number https://leetcode.com/problems/missing-number/description/ Missing Number - LeetCode Missing Number - Given an array nums containing n distinct numbers in the range [0, n], return the only number in the range that is missing from the array. Example 1: Input: nums = [3,0,1] Output: 2 Explanation: n = 3 since there are 3 numbers, so all n leetcode.com 전수조사 문제였습니다. 📕 풀이방법 📔 풀이과정 1. nums의 원소들을 map m에.. (C++) - LeetCode (easy) 263. Ugly Number https://leetcode.com/problems/ugly-number/description/ Ugly Number - LeetCode Ugly Number - An ugly number is a positive integer whose prime factors are limited to 2, 3, and 5. Given an integer n, return true if n is an ugly number. Example 1: Input: n = 6 Output: true Explanation: 6 = 2 × 3 Example 2: Input: n = 1 Output: true leetcode.com dp방식으로 해결했습니다. 📕 풀이방법 📔 풀이과정 ugly number를 만들기 위해 1부터 시작.. (C++) - LeetCode (easy) 258. Add Digits https://leetcode.com/problems/add-digits/description/ Add Digits - LeetCode Add Digits - Given an integer num, repeatedly add all its digits until the result has only one digit, and return it. Example 1: Input: num = 38 Output: 2 Explanation: The process is 38 --> 3 + 8 --> 11 11 --> 1 + 1 --> 2 Since 2 has only one digit, retu leetcode.com simulation으로 해결한 문제였습니다. 📕 풀이방법 📔 풀이과정 자리수를 확인해 더해주기 위해.. 이전 1 ··· 77 78 79 80 81 82 83 ··· 268 다음