Skip to content

Instantly share code, notes, and snippets.

@geektutor
Last active May 2, 2020 20:39
Show Gist options
  • Save geektutor/85318db2fdc4b02128fd0924b6c180f2 to your computer and use it in GitHub Desktop.
Save geektutor/85318db2fdc4b02128fd0924b6c180f2 to your computer and use it in GitHub Desktop.
Day 1 of 30DaysOfCode
import 'dart:math';
void main(){
print(armstrong(153));
}
armstrong(number) {
var myList = number.toString().split("");
var c = myList.length;
var a = 0;
for (var i = 0; i < c; i++) {
a += pow(int.parse(myList[i]), c);
}
return number == a;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment