Relative sort in O(N)
Finding primes using Sieve method