LeetCode Maximum Subarray Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array , the contiguous subarray has the largest sum = 6. click to show more practice. More... Read More

# Monthly Archives: August 2016

# LeetCode Plus One

LeetCode Plus One Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the... Read More

# LeetCode Combination Sum II

LeetCode Combination Sum II Given a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once in the combination. Note: All numbers... Read More

# LeetCode Combination Sum

LeetCode Combination Sum Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unlimited number of times. Note: All numbers... Read More

# LeetCode Happy Number

LeetCode Happy Number 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... Read More

# LeetCode Next Permutation

LeetCode Next Permutation Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest possible order (ie, sorted in... Read More

# LeetCode Rotate Image

LeetCode Rotate Image You are given an n x n 2D matrix representing an image. Rotate the image by 90 degrees (clockwise). Follow up: Could you do this... Read More

# LeetCode Permutations II

LeetCode Permutations II Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example, have the following unique permutations: , , ... Read More

# LeetCode Length of Last Word

LeetCode 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. If the last word does not exist, return 0. Note: A word is defined as a character... Read More

# LeetCode Permutations

LeetCode Permutations Given a collection of distinct numbers, return all possible permutations. For example, have the following permutations: , , , , , ... Read More