개발차
[알고리즘] 30. Designer PDF Viewer
When you select a contiguous block of text in a PDF viewer, the selection is highlighted with a blue rectangle. In this PDF viewer, each word is highlighted independently. For example:In this challenge, you will be given a list of letter heights in the alphabet and a string. Using the letter heights given, determine the area of the rectangle highlight in assuming all letters are wide.For example..
[알고리즘] 29. The Hurdle Race
Dan is playing a video game in which his character competes in a hurdle race. Hurdles are of varying heights, and Dan has a maximum height he can jump. There is a magic potion he can take that will increase his maximum height by unit for each dose. How many doses of the potion must he take to be able to jump all of the hurdles.Given an array of hurdle heights , and an initial maximum height Dan ..
[알고리즘] 28. Climbing the Leaderboard
Alice is playing an arcade game and wants to climb to the top of the leaderboard and wants to track her ranking. The game uses Dense Ranking, so its leaderboard works like this:The player with the highest score is ranked number on the leaderboard.Players who have equal scores receive the same ranking number, and the next player(s) receive the immediately following ranking number.For example, the..
[알고리즘] 27. Picking Numbers
Given an array of integers, find and print the maximum number of integers you can select from the array such that the absolute difference between any two of the chosen integers is less than or equal to . For example, if your array is , you can create two subarrays meeting the criterion: and . The maximum length subarray has elements.Function DescriptionComplete the pickingNumbers function in the..
[알고리즘] 26. Forming a Magic Square
We define a magic square to be an matrix of distinct positive integers from to where the sum of any row, column, or diagonal of length is always equal to the same number: the magic constant.You will be given a matrix of integers in the inclusive range . We can convert any digit to any other digit in the range at cost of . Given , convert it into a magic square at minimal cost. Print this cost on..
[알고리즘] 25. Cats and a Mouse
Two cats and a mouse are at various positions on a line. You will be given their starting positions. Your task is to determine which cat will reach the mouse first, assuming the mouse doesn't move and the cats travel at equal speed. If the cats arrive at the same time, the mouse will be allowed to move and it will escape while they fight.You are given queries in the form of , , and representing ..