Can any help me With the question Problem Link
This is just an implementation problem. The editorial is given, right?