I wanted to say that I came here because some Hackerrank challenges are so badly explained that I didn't want to waste more time trying to figure out what are they asking for, but I found this even more confusing.
First, the explanation of the problem says:
Firing on a mountain will only destroy part of it, reducing its height.
But when you try and shoot a mountain, it gets reduced to height 0. How is that destroying part of it?
Also, the fact that you don't see the code that prints the heights makes it hard to understand what's happening. Why do I have access to the cin for loop but not the rest? Ok, I build a vector inside (I'm using C++), but apparently there is another vector, array or whatever somewhere, storing the heights; it would make more sense if I already had access to that.
I don't know, pretty disappointing.