We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Separate the chocolate
Separate the chocolate
Sort by
recency
|
21 Discussions
|
Please Login in order to post a comment
Here is Separate the chocolate problem solution in Python Java C++ and C programming - https://programs.programmingoneonone.com/2021/07/hackerrank-separate-the-chocolate-problem-solution.html
not passing the value of k... to define the max differnce b/w pieces..
can't understand the meaning of the question.... plz help....
The problem is not explained properly. Also, confusing language is used.
I feel like I must not be understanding this problem. The 4th test case the input is: 4 8 29
and the expected output is 4.
It seems like with a K of 29 15 solutions are possible, but the tester is looking for a solution of 4. What am I missing?
ex
len(D) = 15, len(T) = 17, abs(len(D)-len(T)) = 2
len(D) = 24, len(T) = 8, abs(len(D)-len(T)) = 16
len(D) = 30, len(T) = 2, abs(len(D)-len(T)) = 28