[HackerRank] Easy
Staircase
- Scan the input (the height of the staircase)
- To count the space and hash
- As the stair goes down, minus the number of space
- As the stair goes down, plus the number of hash
Mini-Max Sum
- Make the array to input the numbers
- Input the numbers to the array
- First let the max, min and sum to the z[0]
- Compare with next number, and if it is bigger than z[0] then change the max to it
- Compare with next number, and if it is smaller than z[0], let it to the min number
- Sum all numbers which are contained in array
- Print out the sum-max and sum-min
Birthday Cake Candles
- Scan the number of candles
- Make the array to contain the heights of them
- Find the tallest candle by comparing each
- Similar to the problem of mini-max, to find the max number
- Count the number of the tallest candle
'CSS 동아리_ > [HackerRank]' 카테고리의 다른 글
[HackerRank] 2019.05.13-2019.05.19 (0) | 2019.05.22 |
---|---|
[HackerRank] Easy (0) | 2019.05.12 |