본문 바로가기

Algorithm

(2149)
(Python3) - LeetCode (Easy) : 2996. Smallest Missing Integer Greater Than Sequential Prefix Sum https://leetcode.com/problems/smallest-missing-integer-greater-than-sequential-prefix-sum Smallest Missing Integer Greater Than Sequential Prefix Sum - LeetCodeCan you solve this real interview question? Smallest Missing Integer Greater Than Sequential Prefix Sum - You are given a 0-indexed array of integers nums. A prefix nums[0..i] is sequential if, for all 1 leetcode.com간단 구현문제였습니다.📕 풀이방법📔 ..
(Python3) - LeetCode (Medium) : 1140. Stone Game II https://leetcode.com/problems/stone-game-ii Stone Game II - LeetCodeCan you solve this real interview question? Stone Game II - Alice and Bob continue their games with piles of stones. There are a number of piles arranged in a row, and each pile has a positive integer number of stones piles[i]. The objective of the game isleetcode.commemoization dp로 해결한 문제였습니다📕 풀이방법📔 입력 및 초기화📑 memoization을 위한..
(Python3) - LeetCode (Medium) : 3310. Remove Methods From Project https://leetcode.com/problems/remove-methods-from-project Remove Methods From Project - LeetCodeCan you solve this real interview question? Remove Methods From Project - You are maintaining a project that has n methods numbered from 0 to n - 1. You are given two integers n and k, and a 2D integer array invocations, where invocations[i] = [ai, bi] indleetcode.comstack dfs로 해결한 문제였습니다.📕 풀이방법📔 입력..
(Python3) - LeetCode (Easy) : 3731. Find Missing Elements https://leetcode.com/problems/find-missing-elements Find Missing Elements - LeetCodeCan you solve this real interview question? Find Missing Elements - You are given an integer array nums consisting of unique integers. Originally, nums contained every integer within a certain range. However, some integers might have gone missing from theleetcode.comset 을 사용해본 문제였습니다. 값만 저장하는 자료구조로 저장 삽입 삭제가 O(1)..
(Python3) - LeetCode (Easy) : 3014. Minimum Number of Pushes to Type Word I https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-i Minimum Number of Pushes to Type Word I - LeetCodeCan you solve this real interview question? Minimum Number of Pushes to Type Word I - You are given a string word containing distinct lowercase English letters. Telephone keypads have keys mapped with distinct collections of lowercase English letters, whicleetcode.com비둘기집 원리를 생..
(Python3) - LeetCode (Medium) : 3517. Smallest Palindromic Rearrangement I https://leetcode.com/problems/smallest-palindromic-rearrangement-i Smallest Palindromic Rearrangement I - LeetCodeCan you solve this real interview question? Smallest Palindromic Rearrangement I - You are given a palindromic string s. Return the lexicographically smallest palindromic permutation of s. Example 1: Input: s = "z" Output: "z" Explanation: A string of oleetcode.com정렬을 통해 해결한 문제였습니다..
(Python3) - LeetCode (Easy) : 3536. Maximum Product of Two Digits https://leetcode.com/problems/maximum-product-of-two-digits Maximum Product of Two Digits - LeetCodeCan you solve this real interview question? Maximum Product of Two Digits - You are given a positive integer n. Return the maximum product of any two digits in n. Note: You may use the same digit twice if it appears more than once in n. Example 1: Inputleetcode.com구현 문제였습니다📕 풀이방법📔 입력 및 초기화📑 입..
(Python3) - LeetCode (Medium) : 3867. Sum of GCD of Formed Pairs https://leetcode.com/problems/sum-of-gcd-of-formed-pairs Sum of GCD of Formed Pairs - LeetCodeCan you solve this real interview question? Sum of GCD of Formed Pairs - You are given an integer array nums of length n. Construct an array prefixGcd where for each index i: * Let mxi = max(nums[0], nums[1], ..., nums[i]). * prefixGcd[i] = gcd(nums[i], mxleetcode.com유클리드 gcd 구현해보고 자료구조와 정렬해보는 문제였습니다.📕..