Wrong problem statement or wrong solution


#1

First, it is not clear that problem says to maximise the number of the kicks or the sum of the kicks power.
If it says maximise the number of kicks then it become a greedy problem.
If it says maximise the sum of kicks then number of kicks. Then solution is wrong.
Given solution
does not pass my test case:
Input
A 20
B [ 3 3 5 ]
Output should be
[ 0 0 0 0 0 2 ]
but it returns
[ 0 0 0 0 0 0 ]


#2

it’s probably because your output is lexicographically larger than the output they are giving