归档 2016年4月

[LeetCode]Reverse Vowels of a String

题目描述:

LeetCode 345. Reverse Vowels of a String

Write a function that takes a string as input and reverse only the vowels of a string.

Example 1:

Given s = "hello", return "holle".

Example 2:

Given s = "leetcode", return "leotcede".

题目大意:

编写函数输入一个字符串 ...

继续阅读

[LeetCode]Reverse String

题目描述:

LeetCode 344. Reverse String

Write a function that takes a string as input and returns the string reversed.

Example:

Given s = "hello", return "olleh".

题目大意:

编写函数输入字符串,返回其逆置。

例如输入s = "hello",返回"olleh"。

解题思路:

简单题,略。

Python代码:

class Solution(object):
    def reverseString ...

继续阅读

[LeetCode]Flatten Nested List Iterator

题目描述:

LeetCode 341. Flatten Nested List Iterator

Given a nested list of integers, implement an iterator to flatten it.

Each element is either an integer, or a list -- whose elements may also be integers or other lists.

Example 1:
Given ...

继续阅读

每日归档

上个月

下个月

归档