Guest User

nim lc

a guest
Jun 17th, 2015
327
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nim 0.14 KB | None | 0 0
  1. import future
  2.  
  3. proc enumerate[T](xs: seq[T]): seq[tuple[i:int, x:T]] =
  4.   lc[(i,x) | (i <- 0..xs.high, x <- xs, xs[i] == x), tuple[i:int, x:T]]
Advertisement
Add Comment
Please, Sign In to add comment