Custom Interval — LeetCode 2805 Python Solution
MediumLeetCode PremiumJavaScript
- Problem
- #2805
- Reading time
- 2 min
- Source
- leetcode.com
The problem
Function customInterval Given a function fn, a number delay and a number period, return a number id. customInterval is a function that should execute the provided function fn at intervals based on a linear pattern defined by the formula delay + period * count.
Example
- Input
- delay = 50, period = 20, cancelTime = 225
- Output
- [50,120,210]
- Explanation
- const t = performance.now()
Complexity
| Measure | Complexity |
|---|---|
| Time | O(n) |
| Space | O(1) to O(n) auxiliary |
Related problems
Frequently asked questions
- How hard is LeetCode 2805. Custom Interval?
- LeetCode 2805. Custom Interval is rated Medium on LeetCode.
- What topics does LeetCode 2805. Custom Interval cover?
- LeetCode 2805. Custom Interval is tagged JavaScript on LeetCode.
- Is LeetCode 2805. Custom Interval a premium problem?
- Yes. LeetCode 2805. Custom Interval is a LeetCode Premium problem, so the full statement and test cases require a paid LeetCode subscription.