Prateek loves candy Question

Code is successfully running but in test case its showing time limit
https://ide.codingblocks.com/s/54466

Hi lavish,in this question you have to use the seive method as this method reduces the time complexity.

How can I use sieve method without using array

Hey, You can’t implement a sieve without using array… you are supposed to use an array to implement the sieve of eratosthenes.