Meta / Amazon / Google Interview Question — LeetCode 1231

Y Tech
2 min readFeb 5, 2022

In this post, we are going to discuss leetcode 1231 — Divide Chocolate, which is asked in Google, Meta, and Amazon interviews.

Problem Analysis

You have one chocolate bar that consists of some chunks. Each chunk has its own sweetness given by the array sweetness.

You want to share the chocolate with your k friends so you start cutting the chocolate bar into k + 1 pieces using k cuts, each piece consists of some consecutive chunks.

--

--