MediumNo. 2805LeetCode Premium

Custom Interval — LeetCode 2805 Python Solution

Topics
JavaScript
Reading time
2 min

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

Related problems
No.ProblemDifficulty
2798Number of Employees Who Met the TargetEasy
0057Insert IntervalMedium
0192Word FrequencyMedium
0193Valid Phone NumbersEasy
0194Transpose FileMedium
0195Tenth LineEasy

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.

Stuck on problems like this in a live interview?

Stealth Interview is a desktop app for macOS and Windows. It reads the problem off your screen and returns a working solution with a step-by-step explanation and its time and space complexity, invisible to screen sharing.

Free to download. Check it runs on your machine, then pick a plan.