We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Your method helps to pass all test cases but i don't understand why that works. why n*p>=N works? why are no prime factors for each number considered? how do you arrive at that? I mean I tried everthing else then simply followed the algorithm in your picture but i don't understand at all how it works!
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Join us
Create a HackerRank account
Be part of a 26 million-strong community of developers
Please signup or login in order to view this challenge
Project Euler #69: Totient maximum
You are viewing a single comment's thread. Return to all comments →
I draw a diagram which shows step-by-step solution here
Hope it helps you understand easier
Your method helps to pass all test cases but i don't understand why that works. why n*p>=N works? why are no prime factors for each number considered? how do you arrive at that? I mean I tried everthing else then simply followed the algorithm in your picture but i don't understand at all how it works!