Separate the chocolate
Separate the chocolate
+ 0 comments 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
+ 0 comments not passing the value of k... to define the max differnce b/w pieces..
+ 0 comments can't understand the meaning of the question.... plz help....
+ 0 comments The problem is not explained properly. Also, confusing language is used.
+ 0 comments I feel like I must not be understanding this problem. The 4th test case the input is: 4 8 29
UUUUUUUU DDDUDDDD UUUUUUUU UUUUUUUU
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
[ DDDDDDDD ] [ DDDTDDDD ] [ TTTTTTTT ] [ TTTTTTTT ]
len(D) = 15, len(T) = 17, abs(len(D)-len(T)) = 2
[ DDDDDDDD ] [ DDDDDDDD ] [ DDDDDDDD ] [ TTTTTTTT ]
len(D) = 24, len(T) = 8, abs(len(D)-len(T)) = 16
[ DDDDDDDD ] [ DDDDDDDD ] [ DDDDDDDD ] [ DDDDDDTT ]
len(D) = 30, len(T) = 2, abs(len(D)-len(T)) = 28
Sort 21 Discussions, By:
Please Login in order to post a comment