TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to solve HackerRank's 20/20 hack challenges

2 pointsby rvivekabout 12 years ago

1 comment

cd444vabout 12 years ago
I looked over a bunch of the top ranking solutions on the leaderboard for Alien Languages and over 90% of the solutions that ranked 1 used the integer 20 in their loops. for example, username test123test123 used---------------------------------------------<p>for (int k = 0; k &#60;= i and k &#60;= 20; k ++)<p>username damian_straszak used-----------------------------------------<p>for(int i=0;i&#60;20;i++)<p>Khongor used-------------------------------------------------------------------<p>for (int i = 1; i &#60;= 20; i++)<p>XaCaHaa used-------------------------------------------------------------------<p>define MATRIXN 20<p>for (int i = 0; i &#60; MATRIXN; i++)<p>Where did this number come from? Did it come from some type of algorithm? I saw so many of the top scored codes use this and I am baffled at how they came up with the use of the number 20. I have looked over and over this problem and I don't understand how they came up with the use of 20. I read the editorial done by megaterik on the hackerrank blog on how they came up with their solution (which they choice to do in Java, while I used C++) but yet they also used 20 and never mentioned why they used 20 in the editorial. I would love to know how they came up with the use of the number 20 for their solution.
评论 #5741259 未加载