4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

駿台予備校広告のあの答え合わせをJuliaで一行でやってみた

Last updated at Posted at 2022-01-20

https://qiita.com/sano192/items/a27a481395ce8827bbf6
https://qiita.com/TSeri/items/6958d0ad98d4beb7571d

要するに,6文字の順列を作り,重複を省いて,ソートして,100 番目の要素を出力する。
Julia なら,順列を生成する Combinatorics.nthperm を使う。

using Combinatorics
sort(unique(join(nthperm(split("GAKKOU", ""), i)) for i in 1:factorial(6)))[100]
4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?