Skip to main content

Posts

Showing posts with the label Problem Solving Java

Designer PDF Viewer - HackerRank Problems

Difficulty: EASY Problem : The objective here is to find the size of the highlighted area, and we are given the size's of all the alphabets, we have to find the largest alphabet in the highlighted word and then calculate the size of the rectangle so if the tallest character is 3 then the size of the box will be 3 * number of characters given. Visual representation of the selection : abc def ghij Inputs An array with the sizes of all alphabets a-z in order. A String of highlighted words. Important points to note The array which holds the height of each character in ascending order which means the arrays 0th index will have the height of a 1st index will have the height of b and so on and so forth in the end the hight of z will be there so it's easy to locate each character. A String with the highlighted word. This means we have got the characters inside the rectangle, all we have to find is

Breaking the Records - HackerRank- Problem Solving in Java

Difficulty : EASY Problem : Maria plays college basketball and wants to go pro. Each season she maintains a record of her play. She tabulates the number of times she breaks her season record for most points and least points in a game. Points scored in the first game establish her record for the season, and she begins counting from there. Visual representation of the table Game Score Minimum Maximum Count Min Count Max 0 12 12 12 0 0 1 24 12 24 0 1 2 10 10 24 1 1 3 24 10 24 1 1 Ouput : [1 , 2] Imporant Points to note We canculate the record determining her performance on Game 0(which is highlited in green) which will the value of minimum and maximum. We change the value of maximum