The inner loop runs from p*p to N, and for each prime number p, it eliminates the multiples of p up to N.The outer loop runs from 2 to the square root of N, so it runs in O(sqrt(N)) time.Software Engineering Interview Questions.Top 10 System Design Interview Questions and Answers.Top 20 Puzzles Commonly Asked During SDE Interviews.Commonly Asked Data Structure Interview Questions.Top 10 algorithms in Interview Questions.Top 20 Dynamic Programming Interview Questions.Top 20 Hashing Technique based Interview Questions.Top 50 Dynamic Programming (DP) Problems.
Top 20 Greedy Algorithms Interview Questions.Top 100 DSA Interview Questions Topic-wise.