Searce Interview Question

Cake puzzle One live coding in hackerrank