LeetCodeInterval CancellationInterval CancellationEasySolution export function cancellable<T>(fn: (...args: T[]) => void, args: T[], t: number): () => void { fn(...args); const intervalId = setInterval(() => { fn(...args); }, t); return () => { clearInterval(intervalId); }; }LeetCodeInterval Cancellationhttps://leetcode.com/problems/interval-cancellation