aboutsummaryrefslogtreecommitdiff
path: root/challenge-263/asherbhs/hy/ch-1.hy
blob: 18d3fa3127f231190eedf9585191b39500d8392e (plain)
1
2
3
4
5
6
7
8
9
(defn target-index [ints k] (lfor
  [i n] (enumerate (sorted ints))
  :if (= n k)
  i
))

(print (target-index [1 5 3 2 4 2] 2))
(print (target-index [1 2 4 3 5]   6))
(print (target-index [5 3 2 4 2 1] 4))