Showing 8 questions
Given a sequence of words and a line width, format the text to fit within the specified width. You must justify the text, distributing extra spaces evenly between words.
#1. Text Justification
Calculate the N-th Tribonacci number, where each number is the sum of the previous three numbers. You're given the value of N, and initial values for the first three Tribonacci numbers.
#2. N-th Tribonacci Number
You're given an array of numbers. Find the minimum number of increments needed to make all the numbers in the array unique.
#3. Minimum Increment to Make Array Unique
Starting from (0, 0), can you reach a target point (tx, ty) by repeatedly applying the transformation (x, y) -> (x, x+y) or (x, y) -> (x+y, y)? Determine if it's possible.
#4. Reaching Points
Calculate the number of possible music playlists given constraints on the number of songs, distinct songs, and playlist length. Each song must be played at least once.
#5. Number of Music Playlists
A special binary string has equal numbers of 0s and 1s, and any prefix has at least as many 1s as 0s. You need to recursively make the lexicographically largest special string possible from a given special binary string.
#6. Special Binary String
Find the minimum number of moves required to make all elements in an array equal, where a move consists of incrementing n - 1 elements by 1.
#7. Minimum Moves to Equal Array Elements
You're given a list of votes for teams, where each vote ranks the teams in order. Determine the final ranking of the teams based on these votes, prioritizing teams with higher rankings in the votes.
#8. Rank Teams by Votes