Editorial is given in Java

The editorial that has been provided in the solutions section is in Java due to which I find it difficult to understand the solution. I request you to provide the editorial in C++.

Could you pls explain the second line of the code?