LeetCode 152.Maximum Product Subarray
Description:
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
Debug myself and debug the world!
Find the contiguous subarray within an array (containing at least one number) which has the largest product.
Given an array consisting of n integers, find the contiguous subarray of given length k that has the maximum average value. And you need to output the maximum average value.
Given an unsorted array of integers, find the number of longest increasing subsequence.
Given an unsorted array of integers, find the length of longest continuous increasing subsequence.
Given a non-empty 2D array grid of 0’s and 1’s, an island is a group of 1’s (representing land) connected 4-directionally (horizontal or vertical.) You may assume all four edges of the grid are surrounded by water.
Find the maximum area of an island in the given 2D array. (If there is no island, the maximum area is 0.)
Difficulty: Easy
Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements.
Your task is to find the smallest possible length of a (contiguous) subarray of nums, that has the same degree as nums.
Write a function to find the longest common prefix string amongst an array of strings.
Difficulty:Easy
Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.
Difficulty:Easy
Determine whether an integer is a palindrome. Do this without extra space.
Some hints:
Could negative integers be palindromes? (ie, -1)
If you are thinking of converting the integer to string, note the restriction of using extra space.
You could also try reversing an integer. However, if you have solved the problem “Reverse Integer”, you know that the reversed integer might overflow. How would you handle such case?
There is a more generic way of solving this problem.
Difficulty:Easy
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
Difficulty:Easy