Building Towers

Anyone know why this code is wrong Solution: 58128715 | CodeChef?

2 Likes

not sure but I’ve got WA in 3rd test case too. @prakhar_87 could you reveal the third test case.
my soln : Solution: 58126155 | CodeChef

damn it. I tried by luck change tower = 0 to tower = 1 at the beginning and pass in my code Solution: 58143035 | CodeChef

did’nt get it , can you please provide me the 3rd test case that was wrong and how did you fix that issue.

I didn’t figure out which case failed in mine, but a luck pass. but i just figure out yours

you case failed this
1
1 0

this should be 0 not 1

pass: Solution: 58144189 | CodeChef

For M = 0 , output will always be 0, since you can’t perform any operation on the blocks present in the inventory

1 Like

ooff i regret it now, such a silly yet a grave mistake :sob: :sob:

I guess your code won’t work for X = 1 and M = 1. Output should be 1 since we can build tower of height 1 in 1 operation @henrychen222

thanks!