So I am working my way through the JS Basic Algorithm Challenges and just finished the Return Largest Numbers in Arrays challenge. I passed the challenge (yay!) but I went to the “Hints” section afterwards to compare my answer and see that fcc lists 4 ways to solve this challenge. My solution matches the “procedural method”.
Thing is, the other 3 ways listed to solve it I would not have come up with at this stage (and they have much less code). I’ve noticed this same sort of thing on the last couple of challenges.
I “get” the recursive approach and I used recursion to solve the “Factorialize” challenge, but the 2 Declarative solutions to this are not intuitive to me like the other ways. Once I studied them several times I understand them but I am still not sure I would come up with them again on my own, so my question is should I be focusing on being able to solve these challenges every way listed or just solving them with whatever I come up with?
Cheers