aboutsummaryrefslogtreecommitdiff
path: root/other/number_steps_to_0.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'other/number_steps_to_0.cpp')
-rw-r--r--other/number_steps_to_0.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/other/number_steps_to_0.cpp b/other/number_steps_to_0.cpp
deleted file mode 100644
index 2683dca..0000000
--- a/other/number_steps_to_0.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "leetcode.h"
-
-class Solution {
-public:
- int numberOfSteps(int num) {
- int steps = 0;
- while (num) {
- if (num % 2 == 0)
- num /= 2, steps++;
- else
- num--, steps++;
- }
- return steps;
- }
-};
-
-int main() {
- Solution obj;
- cout << obj.numberOfSteps(1043);
-}