📄️ Counter
Given an integer n, return a counter function. This counter function initially returns n and then returns 1 more than the previous value every subsequent time it is called (n, n + 1, n + 2, etc).
📄️ Sleep
Given a positive integer millis, write an asynchronous function that sleeps for millis milliseconds. It can resolve any value.
📄️ Cache with Time
Write a class that allows getting and setting key-value pairs, however a time until expiration is associated with each key.
📄️ Memoize
Given a function fn, return a memoized version of that function.
📄️ Recursive Flatten
Given a multi-dimensional array arr and a depth n, return a flattened version of that array.
📄️ Array Reduce Transformation
Given an integer array nums, a reducer function fn, and an initial value init, return a reduced array.
📄️ Function Composition
Given an array of functions [f1, f2, f3, ..., fn], return a new function fn that is the function composition of the array of functions.
📄️ Filter Elements From Array
Given an integer array arr and a filtering function fn, return a filtered array filteredArr.
📄️ Group By
Write code that enhances all arrays such that you can call the array.groupBy(fn) method on any array and it will return a grouped version of the array.
📄️ Promise Time Limit
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.
📄️ Fibonnacci
Write a generator function that returns a generator object which yields the fibonacci sequence.
📄️ Nested Array Generator
Given a multi-dimensional array of integers, return a generator object which yields integers in the same order as inorder traversal.
📄️ Counter Two
Write a function createCounter. It should accept an initial integer init. It should return an object with three functions.
📄️ Event Emitter
Design an EventEmitter class. This interface is similar (but with some differences) to the one found in Node.js or the Event Target interface of the DOM. The EventEmitter should allow for subscribing to events and emitting them.
📄️ To Be or Not To Be
Write a function expect that helps developers test their code. It should take in any value val and return an object with the following two functions.
📄️ Execute Asynchronous Functions In Parallel
Given an array of asynchronous functions functions, return a new promise promise. Each function in the array accepts no arguments and returns a promise.
📄️ Compact Object
Given an object or array obj, return a compact object. A compact object is the same as the original object, except with keys containing falsy values removed. This operation applies to the object and any nested objects. Arrays are considered objects where the indices are keys. A value is considered falsy when Boolean(value) returns false.
📄️ Join Two Arrays By Id
Given two arrays arr1 and arr2, return a new array joinedArray. All the objects in each of the two inputs arrays will contain an id field that has an integer value. joinedArray is an array formed by merging arr1 and arr2 based on their id key. The length of joinedArray should be the length of unique values of id. The returned array should be sorted in ascending order based on the id key.
📄️ Array Prototype Last
Write code that enhances all arrays such that you can call the array.last() method on any array and it will return the last element. If there are no elements in the array, it should return -1.
📄️ Reverse words in a string
Given an input string s, reverse the order of the words.
📄️ Zigzag Conversion
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)
📄️ Merge Sorted Array
You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.
📄️ Valid Palindrome
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.
📄️ Two Sum II
Given a 1-indexed array of integers numbers that is already sorted in non-decreasing order, find two numbers such that they add up to a specific target number. Let these two numbers be numbers[index1] and numbers[index2] where 1 <= index1 < index2 < numbers.length.
📄️ Container with most water
You are given an integer array height of length n. There are n vertical lines drawn such that the two endpoints of the ith line are (i, 0) and (i, height[i]).
📄️ Minimum size subarray sum
Given an array of positive integers nums and a positive integer target, return the minimal length of a
📄️ Longest substring without repeating characters
Given a string s, find the length of the longest substring without repeating characters.
📄️ Valid Sudoku
Determine if a 9 x 9 Sudoku board is valid. Only the filled cells need to be validated according to the following rules:
📄️ Group Anagrams
Given an array of strings strs, group the anagrams together. You can return the answer in any order.
📄️ Summary Ranges
You are given a sorted unique integer array nums.
📄️ Merge Intervals
Given an array of intervals where intervals[i] = [starti, endi], merge all overlapping intervals, and return an array of the non-overlapping intervals that cover all the intervals in the input.