Happy segments

Problem Name:
Happy segments
Site:HackerEarth
Links:
Tags:
Problem setters: