The final loop runs from 2 to N, so it has a time complexity of O(N).This is because the sum of the reciprocals of the prime numbers up to N is asymptotically bounded by log(log(N)). Therefore, the inner loop runs at most N/p times for each prime number p, so it has a time complexity of O(N/2 + N/3 + N/5 + …), which is approximately O(N log(log(N))). 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.ISRO CS Syllabus for Scientist/Engineer Exam.ISRO CS Original Papers and Official Keys.GATE CS Original Papers and Official Keys.Top 10 System Design Interview Questions and Answers.Top 20 Puzzles Commonly Asked During SDE Interviews.Top 100 DSA Interview Questions Topic-wise.