MediumNo. 2805LeetCode Premium
Custom Interval — LeetCode 2805 Python Solution
- Topics
- JavaScript
- 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
- Time
- O(n)
- Space · auxiliary
- O(1) to O(n)
Related problems
| No. | Problem | Difficulty |
|---|---|---|
| 2798 | Number of Employees Who Met the Target | Easy |
| 0057 | Insert Interval | Medium |
| 0192 | Word Frequency | Medium |
| 0193 | Valid Phone Numbers | Easy |
| 0194 | Transpose File | Medium |
| 0195 | Tenth Line | Easy |
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.