added cakes question from hackerrank in java