- Given a list of numbers and a number k, return whether any two numbers from the list add up to k.
- Given an array of integers, return a new array such that each element at index i of the new array is the product of all the numbers in the original array except the one at i.
- Given the root to a binary tree, implement serialize(root), which serializes the tree into a string, and deserialize(s), which deserializes the string back into the tree.
- Given an array of integers, find the first missing positive integer in linear time and constant space. In other words, find the lowest positive integer that does not exist in the array. The array can contain duplicates and negative numbers as well.
- cons(a, b) constructs a pair, and car(pair) and cdr(pair) returns the first and last element of that pair.(...)
- Implement an XOR linked list
- Given the mapping a = 1, b = 2, ... z = 26, and an encoded message, count the number of ways it can be decoded.
- Given a list of integers, write a function that returns the largest sum of non-adjacent numbers.
- Implement a job scheduler which takes in a function f and an integer n, and calls f after n milliseconds.
- Implement an autocomplete system.
- There exists a staircase with N steps, and you can climb up either 1 or 2 steps at a time. Given N, write a function that returns the number of unique ways you can climb the staircase. The order of the steps matters.
- Given an integer k and a string s, find the length of the longest substring that contains at most k distinct characters.
- Given a stream of elements too large to store in memory, pick a random element from the stream with uniform probability.
- You run an e-commerce website and want to record the last N order ids in a log.
- Given a string representing the file system in the above format, return the length of the longest absolute path to a file in the abstracted file system. If there is no file in the system, return 0.
- Given an array of integers and a number k, where 1 <= k <= length of the array, compute the maximum values of each subarray of length k.
- Given two singly linked lists that intersect at some point, find the intersecting node. The lists are non-cyclical.
- Given an array of time intervals (start, end) for classroom lectures (possibly overlapping), find the minimum number of rooms required.
- Given a dictionary of words and a string made up of those words (no spaces), return the original sentence in a list.
- Given a string of round, curly, and square open and closing brackets, return whether the brackets are balanced (well-formed).
- You have an N by N board. Write a function that, given N, returns the number of possible arrangements of the board where N queens can be placed on the board without threatening each other, i.e. no two queens share the same row, column, or diagonal.
- Using a function rand5() that returns an integer from 1 to 5 (inclusive) with uniform probability, implement a function rand7() that returns an integer from 1 to 7 (inclusive).
-
Notifications
You must be signed in to change notification settings - Fork 1
Daily Coding Problem
M1nified/DCP
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Daily Coding Problem
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published