## New Array Subarray Solution

New Array Subarray PrepBuddy gave you an array of length NN: A1,A2,..,ANA1,A2,..,AN. And, this array is composed of integers between 11 to MM. Construct a new array of length NN: A′1,A′2,..,A′NA1′,A2′,..,AN′, such that: New array A′A′ has integers between 1 to MM. The number of i where Ai!=A′iAi!=Ai′ is not more than KK. XX is … Read more

## Arrange Guest Solution

Arrange Guest Prepbuddy is the manager of the marriage hall and he gets a booking for the biggest marriage in the town. The hall has N×MN×M seats, arranged in NN rows, MM seats in each row. Each seat has two coordinates (X,Y)(X,Y). On the marriage day, there are two queues of guests waiting to enter … Read more

## Construct Rectangle Solution

Construct Rectangle Prepbuddy came to visit his friend and noticed that his friend owns an incredibly beautiful rectangle with sides XX and YY. Prepbuddy realized that he had always dreamed about a rectangle of such an area. After returning to his home Prepbuddy has found out that he has a lot of squares of size … Read more

## Go Go Home Solution

Go Go Home There are NN apartments along a number line, numbered 11 through NN. Apartment ii is located at coordinate XiXi. Also, the office of Prepbyte Inc. is located at coordinate SS. Every employee of Prepbytes lives in one of the NN apartments. There are PiPi employees who are living in Apartment ii. All … Read more

## Dark Moments Solution

Dark Moments Prepbuddy is fond of traveling via trains. So he planned a journey to prepland and he is traveling by train right now. The train has NN cars, the length of the ithith car is AiAi meters. Let us ignore the distance between the cars. Prepbuddy noticed that some cars have the light on, … Read more