Yearly Archives: 2015


[leetcode] Basic Calculator

Basic Calculator Implement a basic calculator to evaluate a simple expression string. The expression string may contain open ( and closing parentheses ), the plus + or minus sign -, non-negative integers and empty spaces . You may assume that the given expression is always valid. Some examples: “1 + […]


[leetcode] Number of 1 Bits

Number of 1 Bits Write a function that takes an unsigned integer and returns the number of ’1′ bits it has (also known as the Hamming weight). For example, the 32-bit integer ’11′ has binary representation 00000000000000000000000000001011, so the function should return 3. Credits: Special thanks to @ts for adding […]