Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

1.1 KiB
Raw Blame History

id, title, challengeType, videoUrl, dashedName
id title challengeType videoUrl dashedName
5900f3841000cf542c50fe97 问题24字典排列 5 problem-24-lexicographic-permutations

--description--

置换是对象的有序排列。例如3124是数字1,2,3和4的一种可能的排列。如果所有排列都以数字或字母顺序列出我们称之为词典顺序。字典排列0,1和2是

012 021 102 120 201 210

数字0,1,2,3,4,5,6,7,8和9的第n个词典排列是什么?

--hints--

lexicographicPermutations(699999)应该返回1938246570。

assert(lexicographicPermutations(699999) == 1938246570);

lexicographicPermutations(899999)应该返回2536987410。

assert(lexicographicPermutations(899999) == 2536987410);

lexicographicPermutations(900000)应该返回2537014689。

assert(lexicographicPermutations(900000) == 2537014689);

lexicographicPermutations(999999)应该返回2783915460。

assert(lexicographicPermutations(999999) == 2783915460);

--seed--

--seed-contents--

function lexicographicPermutations(n) {

  return n;
}

lexicographicPermutations(999999);

--solutions--

// solution required