Hackerrank yesterday to participate in a contest summary

Source: Internet
Author: User
Tags data structures

Yesterday for the first time to participate in a Hackerrank game, from 11 o'clock Noon to do the night 12 o'clock, finally too tired, at the end of the game one hour to go to bed. Completely passed the first two questions, the third question for a sentence has not been correctly understood, so did not pass the majority of test case, the final ranking in the contest in 23**/60**. Oneself is holding the mentality of study to go, although this achievement has nothing to show off, but still want to summarize.

Find yourself needing to improve
The best top five to do the problem fast and right, indeed a master like the cloud. The first one seemed to have all the right questions, and it took only 5 hours.
See the place where I need to improve

Basic data structure needs to be improved
Because I like to use Java, but for some of the data structure is not very skilled, so spent some time to understand the use of the class,
Like the favorite HashMap, about HashMap, that defines

Hashmap<string,int>

Will error, instead

Hashmap<string,integer>

It's OK.
For the input needs to generate a sort of list, and then in order to access the case, the use of priorityqueue, the personal feel that this class is still very useful.

JUnit is a must.
Because each goal input is poured from the stdin, for simple topics can be manually knocked once, but for complex problems, one time hand knocks will be exhausted, wait, and error prone
Then a few hours before the end of the game, I was fed up with manually entering test cases,
Then we tuned the program architecture and started using JUnit tests,
But the latest JUNIT4 and JUNIT3 have a big adjustment, instead of the test case method before adding @test tag,
And because of the limited environment on the machine, we need to execute JUNIT4 with the command line.
So he groped for some time. After using JUnit, I felt more in my heart.

Seize the time
It was my golden hour in the morning, but I pulled the phone for one hours, and this was a blunder.

Use efficient algorithms as much as possible
Yesterday a problem, the maximum value of an input variable can be up to 100000, and then see the discussion group some people because of time-out and did not pass some test cases, it is estimated that they use a loop nested loop and nested layer nested method.
Therefore, it is possible to avoid brute force search as far as the maximum input value exceeds 50.

Understand test instructions accurately
Yesterday, the third problem in a sentence, the person did not give a detailed explanation, to the last found that they actually do not understand this sentence, but I have no time to discuss the group of inquiry.
So, for this kind of topic, maybe I shouldn't do it first,
Secondly, if I have to do it, I should go to the discussion group to raise my question and try to use a concrete example to ask the people to answer questions.

Boundary value
Yesterday a problem, careless boundary conditions missed a value, resulting in half of the test cases failed. Finally, I fixed it and passed it all.
This is something to prevent, that is, when programming, you control the boundary value, and then simulate this situation.
Sometimes, the boundary value is too large to create the correct test case manually, then you may need to create conditions, for example, yesterday there is a boundary value of up to 100000, if you do not have the conditions under this condition to manually make a correct test case, you can change it to 5, This allows you to manually make a corresponding correct test case, and then test the boundary.

Selection principle
Do your own thorough understanding of the topic, can not understand may not do.
If you have to do it, you should go to the discussion group to ask, understand the meaning, and then do it.
If you do not understand some of the topics, should give up, choose to do other
And according to their own situation, look at the average submission accuracy rate, choose the right level of the topic.

Enhance the learning of algorithms, data structures, and mathematics
At least not wasting time on the basics of data structures, syntax errors, familiarity with classical algorithms, etc.
Strengthening mathematics accomplishment and grasping the essence of problem
In this game, you can focus on the problem itself, not on other details.

You must not copy.
It is not worthwhile to publish your own code to anyone, who will be disqualified from being copied and copied.

Try to help others
Yesterday in the problem solving, suddenly saw someone in 8 hours ago sent news, consult a topic ideas. Although he felt too much food, there was no way anyone would come for help, but it happened. So it is very simple to introduce the general idea.
Help others, but the rules don't allow you to directly tell people about algorithms and code. So we have to grasp the issue of degree.

The topic is in English.
So this is also a good opportunity to practise English.

In a word, I am grateful to have hackerrank this fair competition platform, hope can continue to progress.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.