Could not able to solve it

Правка en2, от nishantdhamija41, 2022-10-06 13:23:23

Give a height of a rectangular wall as H and an array of bricks, where each index i is from (0<=i<length of the array) represent the colour of brick and each element of array represents number of bricks of that colour

for example H=3 and arr=[2,1,2,1,3] means colour of 0 has 2 bricks

colour of 1 has 1 bricks

colour of 2 has 2 bricks

colour of 3 has 1 bricks

colour of 4 has 3 bricks.

Now there are some rules for creating a wall

  1. a wall height height should not be greater than H

  2. each column of wall should contain different color bricks

Find the maximum area of rectangular wall

for H=3 and arr=[2,1,2,1,3] the ans=9; output=> 2 2 3 0 0 1 4 4 4

0<=H,N<=1E5 1<=arr[i]<=1e11

Теги english

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский nishantdhamija41 2022-10-06 13:24:07 78
en2 Английский nishantdhamija41 2022-10-06 13:23:23 12
en1 Английский nishantdhamija41 2022-10-06 13:21:54 899 Initial revision (published)