leetcode 484. Find Permutation 思维题 https://leetcode.com/contest/leetcode-weekly-contest-16a/problems/find-permutation/ 设原本的数字是0,那么按照它的DI来模拟,D就减1,I就+1 比如DDIIDI,就是0、-1、-2、-1、0、-1、0 那么找到第一个最小的,现在是-2,那么把它安排去第一个没出现过的数字,也...
Explanation: Both [2,1,3] and [3,1,2] can construct the secret signature "DI", but since we want to find the one with the smallest lexicographical permutation, you need to output [2,1,3] Note: The input string will only contain the character 'D' and 'I'. The length of input s...
1220-count-vowels-permutation.py 1239-Maximum-Length-of-a-Concatenated-String-with-Unique-Characters.py 1239-maximum-length-of-a-concatenated-string-with-unique-characters.py 1299-Replace-Elements-With-Greatest-Element-On-Right-Side.py 1299-replace-elements-with-greatest-element...
0567-permutation-in-string.rs 0572-subtree-of-another-tree.rs 0605-can-place-flowers.rs 0621-task-scheduler.rs 0647-palindromic-substrings.rs 0680-valid-palindrome-II.rs 0680-valid-palindrome-ii.rs 0682-baseball-game.rs 0684-redundant-connection.rs 0695-max-area-of-island.rs 0703-kth-largest...
LeetCode Find Permutation 原题链接在这里:https://leetcode.com/problems/find-permutation/description/ 题目: By now, you are given a secret signature consisting of character 'D' and 'I'. 'D' represents a decreasing relationship between two numbers, 'I' represents an increasing relationship ...
but since we want to find the one with the smallest lexicographical permutation, you need to output [2,1,3] Note: The input string will only contain the character'D' and 'I'. The length of input string is a positive integer and will not exceed10,000 ...