374. Guess Number Higher or LowerThis question is also a Binary Search question.We can notice one thing.1 <= pick <= n.So this question is search 1 between n.We can search their mid number.If...
303. Range Sum Query - ImmutableThis question is a very clever question.It requires us to reduce the time required for calculation.We need to pay attention to two points.At most 10^4 calls will be ...
242. Valid AnagramThis question is similar to question 205. Isomorphic Strings. They have similarities.We can also use ASCII table to solve it.Solution1public boolean isAnagram(String s, String t) ...
225. Implement Stack using QueuesThis problem requires us to create a last in first out(LIFO) stack.Pay attention to the requirements of this question:You must use only standard operations of a que...
191. Number of 1 BitsThis problem is very similar to problem190.The main idea is still bit operation and XORuse XOR to get the tail numberuse bit operation to remove the mantissasolutionpublic int ...