Advertisement
TheRedRover

6 kyu Does my number look big in this?

Apr 28th, 2020
891
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.12 KB | None | 0 0
  1. def narcissistic(n: Int): Boolean = n.toString.toList.map(_.asDigit) .map(x=>Math.pow(x,n.toString.length).toInt).sum==n
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement