Given an input string, reverse the string word by word.
For example,
Given s = "
return "
Given s = "
the sky is blue",return "
blue is sky the".
Solution:O(n)
the sky is blue",blue is sky the".+, -, *, /. Each operand may be an integer or another expression.["2", "1", "+", "3", "*"] -> ((2 + 1) * 3) -> 9 ["4", "13", "5", "/", "+"] -> (4 + (13 / 5)) -> 6Solution:O(n)
get and set.get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.set(key, value) - Set or insert the value if the key is not already present. When the cache reached its capacity, it should invalidate the least recently used item before inserting a new item.{1,#,2,3}, 1
\
2
/
3
[3,2,1].