Advertisement
Albinutte

Untitled

Mar 4th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. def countDown(n):
  2.     if n % 3:
  3.         return "-1"
  4.     res = [str(i) for i in range(n, 0, -1)]
  5.     for i in range(3, n, 3):
  6.         res[i], res[i + 2] = res[i + 2], res[i]
  7.     return ''.join(res)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement