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.
Can anyone pleasee help me find the 5th Testcase issue or an error in my code? That is the only one failing:
funmain(args:Array<String>){valt=readLine()!!.trim().toInt()for(tItrin1..t){valn=readLine()!!.trim().toLong()getLargePrime(n)}}privatefungetLargePrime(n:Long){/* large = 0 check prime and large than small, assign */vari=2Lvarnumber=nvarlarge=0Lwhile(i<=number){if(number%i==0L){if(large<i)large=inumber/=ii--}i++}println(large)}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #3: Largest prime factor
You are viewing a single comment's thread. Return to all comments →
Can anyone pleasee help me find the 5th Testcase issue or an error in my code? That is the only one failing: