dart
import 'dart:math'; bool autoMorphic(int number) { return pow(number, 2).toString().endsWith(number.toString()); } //print(autoMorphic(13)); //false //print(autoMorphic(25)); //true //print(autoMorphic(6)); //true //print(autoMorphic(625)); //true //print(autoMorphic(225)); //false bool autoMorphic2(int number) { return number != 0 ? pow(number, 2).toString().endsWith(number.abs().toString()) : true; } //print(autoMorphic2(0)); //true //print(autoMorphic2(-25)); //true
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
dart