목록LeetCode (567)
넘치게 채우기
https://leetcode.com/problems/unique-length-3-palindromic-subsequences/description/ Unique Length-3 Palindromic Subsequences - LeetCodeCan you solve this real interview question? Unique Length-3 Palindromic Subsequences - Given a string s, return the number of unique palindromes of length three that are a subsequence of s. Note that even if there are multiple ways to obtain the same subseleetcod..
https://leetcode.com/problems/sort-vowels-in-a-string/description/ Sort Vowels in a String - LeetCode Can you solve this real interview question? Sort Vowels in a String - Given a 0-indexed string s, permute s to get a new string t such that: * All consonants remain in their original places. More formally, if there is an index i with 0
https://leetcode.com/problems/design-graph-with-shortest-path-calculator/description/ Design Graph With Shortest Path Calculator - LeetCode Can you solve this real interview question? Design Graph With Shortest Path Calculator - There is a directed weighted graph that consists of n nodes numbered from 0 to n - 1. The edges of the graph are initially represented by the given array edges where e l..
https://leetcode.com/problems/count-number-of-homogenous-substrings/description/ Count Number of Homogenous Substrings - LeetCode Can you solve this real interview question? Count Number of Homogenous Substrings - Given a string s, return the number of homogenous substrings of s. Since the answer may be too large, return it modulo 109 + 7. A string is homogenous if all the characters leetcode.co..
https://leetcode.com/problems/determine-if-a-cell-is-reachable-at-a-given-time/solutions/ Determine if a Cell Is Reachable at a Given Time - LeetCode Can you solve this real interview question? Determine if a Cell Is Reachable at a Given Time - You are given four integers sx, sy, fx, fy, and a non-negative integer t. In an infinite 2D grid, you start at the cell (sx, sy). Each second, you must m..
https://leetcode.com/problems/eliminate-maximum-number-of-monsters/description/ Eliminate Maximum Number of Monsters - LeetCode Can you solve this real interview question? Eliminate Maximum Number of Monsters - You are playing a video game where you are defending your city from a group of n monsters. You are given a 0-indexed integer array dist of size n, where dist[i] is the initi leetcode.com ..
https://leetcode.com/problems/seat-reservation-manager/description/ Seat Reservation Manager - LeetCode Can you solve this real interview question? Seat Reservation Manager - Design a system that manages the reservation state of n seats that are numbered from 1 to n. Implement the SeatManager class: * SeatManager(int n) Initializes a SeatManager object that leetcode.com leetcode - Seat Reservati..
https://leetcode.com/problems/find-the-winner-of-an-array-game/description/ Find the Winner of an Array Game - LeetCode Can you solve this real interview question? Find the Winner of an Array Game - Given an integer array arr of distinct integers and an integer k. A game will be played between the first two elements of the array (i.e. arr[0] and arr[1]). In each round of th leetcode.com leetcode..
https://leetcode.com/problems/last-moment-before-all-ants-fall-out-of-a-plank/description/ Last Moment Before All Ants Fall Out of a Plank - LeetCode Can you solve this real interview question? Last Moment Before All Ants Fall Out of a Plank - We have a wooden plank of the length n units. Some ants are walking on the plank, each ant moves with a speed of 1 unit per second. Some of the ants move ..
https://leetcode.com/problems/build-an-array-with-stack-operations/description/ 1) { for(int i = 0; i < to-from-1; i++) { operators.push_back("Push"); operators.push_back("Pop"); } } operators.push_back("Push"); } vector buildArray(vector& target, int n) { int lastNum = 0; for(int i = 0; i < target.size(); i++) { operate(lastNum, target[i]); lastNum = target[i]; } return operators; } };