Editorail Solution for this problem

Why is that the editorial of this problem is available in C++ language and not in Java language.

Hi Mohit,
It does not matter whether the code is in c++ or java.if you are able to understand the logic then you can code it in any language.

Hello, in some question only code is given and hence understanding C++ language is bit difficult. That is only my concern.