Given an undirected graph, return true if and only if it is bipartite. Recall that a gr...
Given an undirected graph, return true if and only if it is bipartite. Recall that a gr...
Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line c...
Given two sentences words1, words2 (each represented as an array of strings), and a lis...
On the first row, we write a 0. Now in every subsequent row, we look at the previous ro...
You are playing a simplified Pacman game. You start at the point (0, 0), and your desti...
In a directed graph, we start at some node and every turn, walk along a directed edge o...
In a given array nums of positive integers, find three non-overlapping subarrays with m...
There is a box protected by a password. The password is n digits, where each letter can...
A move consists of taking a point (x, y) and transforming it to either (x, x+y) or (x+y...
Minimize Max Distance to Gas Station On a horizontal number line, we have gas stations ...
Given an array of scores that are non-negative integers. Player 1 picks one of the numb...
Given an array of integers with possible duplicates, randomly output the index of a giv...
題目大意:給一個排列,可能有重復(fù)元素豪硅,我們將數(shù)組拆分成一些“塊”(分區(qū))帜讲,并對每個塊進(jìn)行單獨排序棺耍。連接它們之后糜颠,結(jié)果等于排序后的數(shù)組耕拷。問最多能夠分成多少個分區(qū)(塊)分析:因為...
Given an array consisting of n integers, find the contiguous subarray whose length is g...
Given a chemical formula (given as a string), return the count of each atom. An atomic ...
Given strings S and T, find the minimum (contiguous) substring W of S, so that T is a s...
By now, you are given a secret signature consisting of character 'D' and 'I'. 'D' repre...
You have 4 cards each containing a number from 1 to 9. You need to judge whether they c...
Given two non-negative integers num1 and num2 represented as string, return the sum of ...