Hello there,
If you are working on solving any data structures or algorithm problems while doing certifications on freecodecamp, I would suggest you to look for hints/solutions available (but after solving by your own, of Course) to compare with your solutions. This could improves the way you approach to solutions and other best alternatives to make your code efficient.
Good luck, happy coding!
-Deepak