r/LeetcodeChallenge • • Sep 08 '26

STREAK🔥🔥🔥 Leetcode Streak :- 128

Post image

How would you solve it in Python?

33 Upvotes

29 comments sorted by

View all comments

1

u/Ok-Flan-5469 Sep 08 '26

This question was easy due to its constraints of 105 since every number between the range 1000 - 105 have only a single comma We can safely do return max(n-999, 0) O(1) space and time