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.
I approached it the same way. I've just gotten started on HackerRank, but simple solutions that meet the constraints is a trend I'm noticing on the handful of exercises I've tried.
In the real world a robust, simple, and maintainable solution that is done quickly to the given constraints is far more valuable than the "trick" that is a headscratcher to the next owner. It's always a trade-off to consider whether future expandability is worth the effort now vs. accomplishing the current goal and moving on to the next thing.
The fancy answer can be added into a well-formed interface when the need is actually there.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Linked Lists: Detect a Cycle
You are viewing a single comment's thread. Return to all comments →
I approached it the same way. I've just gotten started on HackerRank, but simple solutions that meet the constraints is a trend I'm noticing on the handful of exercises I've tried.
In the real world a robust, simple, and maintainable solution that is done quickly to the given constraints is far more valuable than the "trick" that is a headscratcher to the next owner. It's always a trade-off to consider whether future expandability is worth the effort now vs. accomplishing the current goal and moving on to the next thing. The fancy answer can be added into a well-formed interface when the need is actually there.