diff options
author | Jack Sangdahl <[email protected]> | 2025-02-03 15:37:19 -0700 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-02-03 15:37:19 -0700 |
commit | 55a67f776dd9acd258cae16ffb636751666b0f40 (patch) | |
tree | 601539de43809b70ceb8228a12c35883fa300b03 /divide_two_int.cpp | |
parent | a0030873dabb517594ae0394350d6715071f7fb8 (diff) | |
download | leetcode-55a67f776dd9acd258cae16ffb636751666b0f40.tar.gz leetcode-55a67f776dd9acd258cae16ffb636751666b0f40.zip |
chore: Remove incomplete solutions
Diffstat (limited to 'divide_two_int.cpp')
-rw-r--r-- | divide_two_int.cpp | 23 |
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() {} |