two solutions added. The second one is more concise and clear.
two solutions added. 1 is o(n), 1 is o(lgn).
o(lgn) is a little bit complex. But good to know.