Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create reverse integer.py #108

Open
wants to merge 224 commits into
base: Lancelot03-patch-1-1
Choose a base branch
from

Conversation

DevilANANDGupta
Copy link
Contributor

class Solution:
def reverse(self, x: int) -> int:
min = -2147483648
max = 2147483647
res = 0
while x:
digit = int(math.fmod(x, 10))
x = int(x/10)
if (res>max //10 or
(res == max// 10 and digit >= max%10)):
return 0
if (res<min //10 or
(res == min// 10 and digit <= min%10)):
return 0
res = (res*10) +digit
return res

avinashthetech and others added 30 commits April 7, 2022 14:13
Create Find the smallest integer in the array.py
Lancelot03 and others added 30 commits October 13, 2022 22:47
Create Delete given node in a Linked List in O(1) approach.cpp
Added Searching and Sorting Techniques
Create Add two numbers represented as Linked Lists.cpp
Create Find intersection of Two Linked Lists.cpp
Create Flattening a Linked List.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.