diff options
Diffstat (limited to 'progs/a910.py')
-rw-r--r-- | progs/a910.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/progs/a910.py b/progs/a910.py new file mode 100644 index 0000000..8485252 --- /dev/null +++ b/progs/a910.py @@ -0,0 +1,7 @@ +def Total_Hamming_Distance(n):
+ i = 1
+ sum = 0
+ while (n // i > 0):
+ sum = sum + n // i
+ i = i * 2
+ return sum
\ No newline at end of file |