aboutsummaryrefslogtreecommitdiff
path: root/divide_two_int.cpp
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-02-03 15:37:19 -0700
committerJack Sangdahl <[email protected]>2025-02-03 15:37:19 -0700
commit55a67f776dd9acd258cae16ffb636751666b0f40 (patch)
tree601539de43809b70ceb8228a12c35883fa300b03 /divide_two_int.cpp
parenta0030873dabb517594ae0394350d6715071f7fb8 (diff)
downloadleetcode-55a67f776dd9acd258cae16ffb636751666b0f40.tar.gz
leetcode-55a67f776dd9acd258cae16ffb636751666b0f40.zip
chore: Remove incomplete solutions
Diffstat (limited to 'divide_two_int.cpp')
-rw-r--r--divide_two_int.cpp23
1 files changed, 0 insertions, 23 deletions
diff --git a/divide_two_int.cpp b/divide_two_int.cpp
deleted file mode 100644
index 6afa1ea..0000000
--- a/divide_two_int.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "leetcode.h"
-
-class Solution {
-public:
- int divide(int dividend, int divisor) {
- if (dividend == INT_MIN && divisor == -1)
- return INT_MAX;
- long dvd = labs(dividend), dvs = labs(divisor), ans = 0;
- int sign = dividend > 0 ^ divisor > 0 ? -1 : 1;
- while (dvd >= dvs) {
- long temp = dvs, m = 1;
- while (temp << 1 <= dvd) {
- temp <<= 1;
- m <<= 1;
- }
- dvd -= temp;
- ans += m;
- }
- return sign * ans;
- }
-};
-
-int main() {}