题目The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in
...
题目The set [1,2,3,...,n] contains a total of n! unique permutations.
By listing and labeling all of the permutations in order, we get the following seq
...
题目Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist
...
题目Given an array of citations sorted in ascending order (each citation is a non-negative integer) of a researcher, write a function to compute the res
...
题目Write a function to check whether an input string is a valid IPv4 address or IPv6 address or neither.
IPv4 addresses are canonically represented in
...
题目Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node’s value equals the given value. Re
...
题目There are n cities connected by m flights. Each flight starts from city u and arrives at v with a price w.
Now given all the cities and flights, tog
...
题目Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies:
Si % Sj = 0 o
...
题目Design a data structure that supports all following operations in average O(1) time.
insert(val): Inserts an item val to the set if not already pre
...