2008-01-17から1日間の記事一覧

アレイのuniq

どう書く?org: アレイのuniq (http://ja.doukaku.org/16/) Pythonの以下の事をRubyでやってみた。 xs = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9] sorted(set(xs), key=xs.index) require 'set' xs = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5, 8, 9, 7, 9] S…