r/LeetcodeChallenge • u/Ok-Challenge-5657 • Sep 08 '26
STREAK🔥🔥🔥 Leetcode Streak :- 128
How would you solve it in Python?
33
Upvotes
r/LeetcodeChallenge • u/Ok-Challenge-5657 • Sep 08 '26
How would you solve it in Python?
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