Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O''s into 'X''s in that surrounded region.
Problem Given a binary tree, return all root-to-leaf paths. Example Given the following binary tree: {代码...} All root-to-leaf paths are: {代码...} Solution {代码...} ###Update 2018-9 {代码...}
Write an algorithm to determine if a number is happy.A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endl...
Give an integer array,find the longest increasing continuous subsequence in this array.An increasing continuous subsequence:Can be from right to left or from left to right.Indices of the integers in the subsequence should be continuous.
Given an integer array, find a continuous subarray where the sum of numbers is the biggest. Your code should return the index of the first number and the index of the last number(If there are duplicate answers, return anyone).
Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges make up a valid tree.