Microsoft Interview Question

the happy string leetcode question