aboutsummaryrefslogtreecommitdiff
path: root/challenge-268/asherbhs/hy/ch-2.hy
blob: 74f305be5242458fd4ae5983fd5d643d2e41544f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
(import
  hyrule    *
  itertools *
)

(require hyrule *)

(defn number-game [ints] (as-> ints it
  (sorted it)
  (batched it 2)
  (map reversed it)
  (chain.from-iterable it)
  (list it)
))

(pprint (number-game [2 5 3 4]))
(pprint (number-game [9 4 1 3 6 4 6 1]))
(pprint (number-game [1 2 2 3]))