Given two integers M and N, generate all primes between M and N.
2 3 5 7
The prime numbers between 1 and 10
are 2,3,5 and 7.
The prime numbers between 2 and 5 are
2,3 and 5.
You don't need to read input or print anything. Your task is to complete the function primeRange() which takes 2 integer inputs M and N and returns a list of all primes between M and N.
Expected Time Complexity:O(N*sqrt(N))
Expected Auxillary Space:O(1)
We strongly recommend solving this problem on your own before viewing its editorial. Do you still
want to view the editorial?
Login to access your submissions.