Searce interview question

Cake puzzle One live coding in hackerrank