Count 1 in Binary

Count how many 1 in binary representation of a 32-bit integer.

Merge Intervals

Given a collection of intervals, merge all overlapping intervals.

Partition Array by Odd and Even

Partition an integers array into odd number first and even number second.

Longest Increasing Continuous Subsequence

Give an integer array´╝îfind the longest increasing continuous subsequence in this array.

Count and Say

The count-and-say sequence is the sequence of integers beginning as follows:

Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.

Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.

Space Replacement

Write a method to replace all spaces in a string with %20. The string is given in a characters array, you can assume it has enough space for replacement and you are given the true length of the string.

Number of Islands

Given a boolean 2D matrix, find the number of islands.