Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite+ 3
What is the minimum time complexity for the problem of finding Leyland numbers ?
Can you tell me what is the time complexity of my code for finding Leyland numbers ? https://code.sololearn.com/clYzkt7S2FZJ/?ref=app
1 Réponse
+ 3
Hello, looks like your code is O(n^2).
Here is my version with O(log(n)*log(n)) complexity. This should be better than O(n).
https://code.sololearn.com/ccAR4EcTfMvt/?ref=app
Additional details here
https://en.m.wikipedia.org/wiki/Leyland_number