204. Count Primes
Question:
Count the number of prime numbers less than a non-negative number, n.
Example:
Input: n = 10
Output: 4
Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.
“Life is not a race, but a journey to be savoured each step of the way” by Brian Dyson
204. Count Primes
Count the number of prime numbers less than a non-negative number, n.
Input: n = 10
Output: 4
Explanation: There are 4 prime numbers less than 10, they are 2, 3, 5, 7.
203. Remove Linked List Elements
Remove all elements from a linked list of integers that have value val.
Input: 1->2->6->3->4->5->6, val = 6
Output: 1->2->3->4->5
202. Happy Number
Write an algorithm to determine if a number n is happy.
A happy number is a number defined by the following process:
Return true if n is a happy number, and false if not.
191. 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).
Note:190. Reverse Bits
Reverse bits of a given 32 bits unsigned integer.
Note:Basic programming - Exponential Search
Given a sorted array, and an element x to be searched, find position of x in the array.
Basic programming - Binary Search
Given a sorted array arr[] of n elements, write a function to search a given element x in arr[].
172. Factorial Trailing Zeroes
Given an integer n, return the number of trailing zeroes in n!.
Follow up: Could you write a solution that works in logarithmic time complexity?
Basic programming - Linear Search
Given an array arr[] of n elements, write a function to search a given element x in arr[].
171. Excel Sheet Column Number
Given a column title as appear in an Excel sheet, return its corresponding column number.
For example:
A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28
...