摘要:
In this problem, a rooted tree is a directed graph such that, there is exactly one node (the root) for which all other nodes are descendants of this n 阅读全文
摘要:
Given an integer array arr of distinct integers and an integer k. A game will be played between the first two elements of the array (i.e. arr[0] and a 阅读全文
摘要:
Given an array of integers arr, and three integers a, b and c. You need to find the number of good triplets. A triplet (arr[i], arr[j], arr[k]) is goo 阅读全文
摘要:
Design a HashSet without using any built-in hash table libraries. To be specific, your design should include these functions: add(value): Insert a val 阅读全文
摘要:
Given an array nums, we call (i, j) an important reverse pair if i < j and nums[i] > 2*nums[j]. You need to return the number of important reverse pai 阅读全文
摘要:
Given a collection of intervals, find the minimum number of intervals you need to remove to make the rest of the intervals non-overlapping. Example 1: 阅读全文
摘要:
There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the hor 阅读全文
摘要:
The Tribonacci sequence Tn is defined as follows: T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0. Given n, return the value of Tn. Exa 阅读全文
摘要:
On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. Y 阅读全文
摘要:
Given an integer array, your task is to find all the different possible increasing subsequences of the given array, and the length of an increasing su 阅读全文