Help in easy problem

can you guys help for the approach of this problem even though there is editorial for this problem
but not getting could you guys help?