Project Euler 16 - Power digit sum

Official link:

Thought Process

We need to design an efficient digit sum function

x % 10 is the last digit of an integer x, then we update x to be be x // 10, which takes off the last digit

Interactive Code

Input an integer (yourinput)

Code will output the digit sum of 2^yourinput