uncommited problems

This commit is contained in:
2022-07-06 00:33:16 +01:00
parent e061a8602f
commit 0c78e204ef
10 changed files with 194 additions and 2 deletions

View File

@@ -0,0 +1,13 @@
package main
func numberOfSteps(num int) (steps int) {
for num != 1 {
if num%2 == 0 {
num /= 2
} else {
num--
}
steps++
}
return steps
}