Bounteous x Accolite interview question

coding round 1 question also need to write the test cases by ourselve