Description

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 sequence consists of non-space characters only.

Example:

Input: "Hello World"
Output: 5

求给出的字符串中最后一个单词的长度。

Read More

Multiply Strings

Description

Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and num2, also represented as a string.

Example 1:

Input: num1 = “2”, num2 = “3” Output: “6”

Example 2:

Input: num1 = “123”, num2 = “456” Output: “56088”

将两个字符串表示的数字相乘(大数相乘)。

Read More

Valid Parentheses

Description

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the correct order, "()" and "()[]{}" are all valid but "(]" and "([)]" are not.

给出包含三种括号的字符串,验证括号是否左右匹配

Read More

Author's picture

SelFree

城市永远年轻,而我们终将老去

Programer

ChengDu·China
-