Hackerearth HourStorm#7

Hey Guys , Do anyone know how to approach this problem link ? Plzz do share your approaches :slight_smile: