Largest Prime Factor | Project Euler 3 | 30 Minutes-ish freeCodeCamp

avatar

So back with some project Euler and retardation that matches a slug traveling to Nevada. This challenge went a bit better, seeing as it took me 20 minutes to learn basic Math from primary and then deciding to cheat and finishing the challenge in 5 minutes or so.

Basically what I am saying is the video is 32 minutes of which only 2 minutes have any form of substance.

There is a way to test for primes using a formula but the higher the number the more false positives you get. You then need to add a list of primes to check against in the test and there are other tests, all of which will take too damn long to figure out.

So for this challenge I had to get the highest Prime factor of a number, this means the biggest prime number that divides into a number and leaving me with 0.

I stole a list of 1000 Prime numbers, reversed it and found the first one that gives me 0 on division. Simple, but probably cheating.






0
0
0.000
1 comments