Next Day — LeetCode 2758 Python Solution
EasyLeetCode PremiumJavaScript
- Problem
- #2758
- Reading time
- 2 min
- Source
- leetcode.com
The problem
Write code that enhances all date objects such that you can call the date.nextDay() method on any date object and it will return the next day in the format YYYY-MM-DD as a string.
Example
- Input
- date = "2014-06-20"
- Output
- "2014-06-21"
- Explanation
- const date = new Date("2014-06-20");
Complexity
| Measure | Complexity |
|---|---|
| Time | O(n) |
| Space | O(1) to O(n) auxiliary |
Related problems
Frequently asked questions
- How hard is LeetCode 2758. Next Day?
- LeetCode 2758. Next Day is rated Easy on LeetCode.
- What topics does LeetCode 2758. Next Day cover?
- LeetCode 2758. Next Day is tagged JavaScript on LeetCode.
- Is LeetCode 2758. Next Day a premium problem?
- Yes. LeetCode 2758. Next Day is a LeetCode Premium problem, so the full statement and test cases require a paid LeetCode subscription.