zvoulgaris

Digits

Mar 20th, 2020
220
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Digits drill
  2.  
  3. function main(n::Int64)
  4.     if (n < 1) || (n > 9); return -1; end
  5.     N = 2*n
  6.     z = Array{Int64}(undef, N - 1)
  7.     for i = 1:n; z[i] = z[N-i] = i; end
  8.     return parse(Int64, join(z, ""))
  9. end
RAW Paste Data