Skip to content

Instantly share code, notes, and snippets.

@geektutor
Created May 3, 2020 03:15
Show Gist options
  • Save geektutor/49b0f943c29789c68e0319e1f35e3cb2 to your computer and use it in GitHub Desktop.
Save geektutor/49b0f943c29789c68e0319e1f35e3cb2 to your computer and use it in GitHub Desktop.
Day 1 Solution of 30 Days Of Code
import 'dart:math';
void main(){
print(armstrong(54748));
}
armstrong(number) {
var myList = number.toString().split("");
var c = myList.iterator;
var a = 0;
while (c.moveNext()) {
a += pow(int.parse(c.current), myList.length);
}
return number == a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment