https://ide.codingblocks.com/s/51611
i m getting wrong ans on submitting the code. plz tell me my mistake
@Abhishek-Vanjani-1385688111468238
https://ide.codingblocks.com/s/51611
i m getting wrong ans on submitting the code. plz tell me my mistake
@Abhishek-Vanjani-1385688111468238
Add the question link.
I checked your code and commented all your errors.
https://ide.codingblocks.com/s/51773
do make the changes and then try submitting it .
Also you didnt need second array in this (i.e array named βbβ in ur code) you needed only array βaβ which stores if a number is prime or not and withthe help of one loop from x to y you can check if number is prime then increment the count.
thank you, all test cases passed, but why we need to initialise the the array with -1 , bcoz i made the "if " condition so that it will count only those no. which are >=x & <=y.?
because you have stored only prime numbers in βbβ array whose size is less than 1000000 and your for loop where youre checking for b[i]>=x&& <=y,starts from 1 to 1000000 and for many b[i] it wonβt exist and it will take by deafult value.