Hexaware Technologies interview question

It was a coding question to solve and pass all test case environments