Skip to content

LeetCode

Chunk Array - 2677

Chunk Array – 2677

🔗LC2677 🟢 Easy 🧩 Pattern – JSON and Arrays 📅 Day 21/30 Days of JavaScript Given an array arr and a chunk size size, return a chunked array. A chunked array contains the original elements in arr; but consists of subarrays each of length size. The length of the last subarray may be less than the size of arr.length is not… Read More »Chunk Array – 2677

Is Object Empty - 2727

Is Object Empty – 2727

🔗LC2727 🟢 Easy 🧩 Pattern – JSON and Objects 📅 Day 20/30 Days of JavaScript Given an object or an array, return if it is empty. You may assume the object or array is the output of JSON.parse. Example Solution

Execute Asynchronous Functions in Parallel - 2721

Execute Asynchronous Functions in Parallel – 2721

🔗LC2721 🟡 Medium 🧩 Pattern – Promises and Time 📅 Day 19/30 Days of JavaScript Given an array of asynchronous functions functions, return a new promise promise. Each function in the array accepts no arguments and returns a promise. All the promises should be executed in parallel. promise resolves: promise rejects: Please solve… Read More »Execute Asynchronous Functions in Parallel – 2721

Debounce - 2627

Debounce – 2627

🔗LC2627 🟡 Medium 🧩 Pattern – Promises and Timeout 📅 Day 18/30 Days of JavaScript Given a function fn and a time in milliseconds t, return a debounced version of that function. A debounced function is a function whose execution is delayed by t milliseconds and whose execution is cancelled if it is called again within that window of time.… Read More »Debounce – 2627

Cache With Time Limit - 2622

Cache With Time Limit – 2622

🔗LC2622 🟡 Medium 🧩 Pattern – Promises and Time, Map 📅 Day 17/30 Days of JavaScript Write a class that allows getting and setting key-value pairs, however a time until expiration is associated with each key. The class has three public methods: set(key, value, duration): accepts an integer key, an integer value, and a duration in milliseconds.… Read More »Cache With Time Limit – 2622

Promise Time Limit - 2637

Promise Time Limit – 2637

🔗LC2637 🟡 Medium 🧩 Pattern – Promises and Time 📅 Day 16/30 Days of JavaScript Given an asynchronous function fn and a time t in milliseconds, return a new time limited version of the input function. fn takes arguments provided to the time limited function. The time limited function should follow these rules: Example Solution