标签归档:leetcode

RSS feed of leetcode

[Leetcode]Reverse Words in a String

题目描述

Given an input string, reverse the string word by word.

For example,
Given s = "the sky is blue",
return "blue is sky the".

Clarification:

What constitutes a word?
A sequence of non-space characters constitutes a word.

Could the input ...

继续阅读

[LeetCode]Maximum Product Subarray

题目描述:

Find the contiguous subarray within an array (containing at least one number) which has the largest product.

For example, given the array [2,3,-2,4],
the contiguous subarray [2,3] has the largest product = 6.

题目大意:

从数组(至少包含一个数字 ...

继续阅读