Given a number A, find all prime numbers up to A (A included). Make sure the returned array is sorted.
Problem Constraints
1 <= A <= 106
Input Format
The first argument is an integer A.
Output Format
Return array of integers.
Example Input
A = 7
Example Output
[2, 3, 5, 7]
Example Explanation
All primes till 7 are, 2, 3, 5 and 7
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified.
Still have a question? Checkout Sample Codes for more details.