Can someone help in the approach for the problem attached?

This post was flagged by the community and is temporarily hidden.

The contest is live bro, Nobody’s gonna tell.

You’re not allowed to ask problems from live contests.

Oh my bad, at the time it showed it got over. Thanks !