So I am on codewars (a coding practice site for programmers) solving coding challenges for fun and then I come across a question that is a little bit harder than usual ๐คจ.
I tried multiple solutions, ate some snacks ๐ฟ, had a bathroom break ๐ฝ (which played a significant role in solving the question later), read some blogs ๐ป, googled (totally normal ๐ ), but the tests were still failing ๐ฌ.
Eventually, maybe 30 mins later, I finally solved the problem ๐ช. I submitted my answer which was around 10 lines (lines don't matter but still). Then, I saw the best answer from the community that solved the problem in just one line ๐. ONE LINE ๐ณ. With pure math ๐งฎ. I was mind-blown ๐คฏ.
Even though it was a correct answer and had many upvotes, many people (me included) have pointed it out that it was hard to read and understand for mainstream developers. For me, this is normal. I don't feel bad about my skills in cases like this, however, for beginners it might be a little upsetting that they couldn't come up with such solutions. To those who are feeling like that, I would say, don't feel frustrated. This is totally normal. One line or 10 lines, it does not matter. What matters is that the code you wrote works, readable and understandable. This is my opinion.
What is your take in this case? At the end of the day, programs are meant to be read by humans and only for computers to execute, right?
Anyway, to give you an idea how insane the answer was just read the comments ๐ :
Top comments (0)