LeetCode (68) 썸네일형 리스트형 1416. Restore The Array / TypeScript A program was supposed to print an array of integers. The program forgot to print whitespaces and the array is printed as a string of digits s and all we know is that all integers in the array were in the range [1, k] and there are no leading zeros in the array.Given the string s and the integer k, return the number of the possible arrays that can be printed as s using the mentioned program. Sin.. 1510. Stone Game IV / TypeScript Alice and Bob take turns playing a game, with Alice starting first.Initially, there are n stones in a pile. On each player's turn, that player makes a move consisting of removing any non-zero square number of stones in the pile.Also, if a player cannot make a move, he/she loses the game.Given a positive integer n, return true if and only if Alice wins the game otherwise return false, assuming bo.. 2386. Find the K-Sum of an Array / TypeScript You are given an integer array nums and a positive integer k. You can choose any subsequence of the array and sum all of its elements together. We define the K-Sum of the array as the kth largest subsequence sum that can be obtained (not necessarily distinct).Return the K-Sum of the array.A subsequence is an array that can be derived from another array by deleting some or no elements without cha.. 2301. Match Substring After Replacement / TypeScript You are given two strings s and sub. You are also given a 2D character array mappings where mappings[i] = [oldi, newi] indicates that you may perform the following operation any number of times:Replace a character oldi of sub with newi.Each character in sub cannot be replaced more than once.Return true if it is possible to make sub a substring of s by replacing zero or more characters according .. 1368. Minimum Cost to Make at Least One Valid Path in a Grid / TypeScript Given an m x n grid. Each cell of the grid has a sign pointing to the next cell you should visit if you are currently in this cell. The sign of grid[i][j] can be:1 which means go to the cell to the right. (i.e go from grid[i][j] to grid[i][j + 1])2 which means go to the cell to the left. (i.e go from grid[i][j] to grid[i][j - 1])3 which means go to the lower cell. (i.e go from grid[i][j] to grid.. 736. Parse Lisp Expression / TypeScript You are given a string expression representing a Lisp-like expression to return the integer value of.The syntax for these expressions is given as follows.An expression is either an integer, let expression, add expression, mult expression, or an assigned variable. Expressions always evaluate to a single integer.(An integer could be positive or negative.)A let expression takes the form "(let v1 e1.. 2193. Minimum Number of Moves to Make Palindrome / TypeScipt You are given a string s consisting only of lowercase English letters.In one move, you can select any two adjacent characters of s and swap them.Return the minimum number of moves needed to make s a palindrome.Note that the input will be generated such that s can always be converted to a palindrome. Example 1:Input: s = "aabb"Output: 2Explanation:We can obtain two palindromes from s, "abba" and .. 1487. Making File Names Unique / TypeScript Given an array of strings names of size n. You will create n folders in your file system such that, at the ith minute, you will create a folder with the name names[i].Since two files cannot have the same name, if you enter a folder name that was previously used, the system will have a suffix addition to its name in the form of (k), where, k is the smallest positive integer such that the obtained.. 이전 1 2 3 4 ··· 9 다음