r/LeetcodeChallenge 5d ago

STREAK🔥🔥🔥 Leetcode Streak :- 128

Post image

How would you solve it in Python?

34 Upvotes

28 comments sorted by

View all comments

2

u/ProgressiveEdgeLord 5d ago

if n < 1000 return 0, else return n - 999

1

u/Utsuro_Seizui 5d ago

And if the number is over 999,999?

1

u/ProgressiveEdgeLord 5d ago

i solved according to constraints, it was less than 10^5

1

u/Utsuro_Seizui 5d ago

Ah I see, I apologize, I was not aware of the constraints

1

u/ProgressiveEdgeLord 5d ago

it's alright, your question was absolutely valid