Coding Test
-
[HackerRank] Number Line Jumps c++Coding Test/HackerRank 2022. 7. 19. 15:49
Problem You are choreographing a circus show with various animals. For one act, you are given two kangaroos on a number line ready to jump in the positive direction (i.e, toward positive infinity). The first kangaroo starts at location x1 and moves at a rate of v1 meters per jump. The second kangaroo starts at location x2 and moves at a rate of v2 meters per jump. You have to figure out a way to..
-
[HackerRank] Apple and Orange c++Coding Test/HackerRank 2022. 7. 19. 13:47
Problem Sam's house has an apple tree and an orange tree that yield an abundance of fruit. Using the information given below, determine the number of apples and oranges that land on Sam's house. In the diagram below: The red region denotes the house, where s is the start point, and t is the endpoint. The apple tree is to the left of the house, and the orange tree is to its right. Assume the tree..
-
[HackerRank] Grading Students c++Coding Test/HackerRank 2022. 7. 18. 19:32
Problem HackerLand University has the following grading policy: - Every student receives a grade in the inclusive range from 0 to 100 . - Any grade less than 40 is a failing grade. Sam is a professor at the university and likes to round each student's grade according to these rules: - If the difference between the and the next multiple of 5 is less than 3, round grade up to the next multiple of ..
-
[HackerRank] Compare the Triplets c++Coding Test/HackerRank 2022. 7. 18. 13:57
Problem Alice and Bob each created one problem for HackerRank. A reviewer rates the two challenges, awarding points on a scale from 1 to 100 for three categories: problem clarity, originality, and difficulty. The rating for Alice's challenge is the triplet a = (a[0], a[1], a[2]), and the rating for Bob's challenge is the triplet b = (b[0], b[1], b[2]). The task is to find their comparison points..
-
[HackerRank] Time Conversion c++Coding Test/HackerRank 2022. 7. 18. 13:30
Problem Given a time in 12 -hour AM/PM format, convert it to military (24-hour) time. Note: - 12:00:00AM on a 12-hour clock is 00:00:00 on a 24-hour clock. - 12:00:00PM on a 12-hour clock is 12:00:00 on a 24-hour clock. Example - s = '12:01:00PM' Return '12:01:00'. - s = '12:01:00AM' Return '00:01:00'. Constraints All input times are valid Sample Input 07:05:45PM Sample Output 19:05:45 Solutions..
-
[HackerRank] Birthday Cake Candles c++Coding Test/HackerRank 2022. 7. 18. 11:34
Problem You are in charge of the cake for a child's birthday. You have decided the cake will have one candle for each year of their total age. They will only be able to blow out the tallest of the candles. Count how many candles are tallest. Example candles = [4,4,1,3] The maximum height candles are 4 units high. There are 2 of them, so return 2. Constraints 1