# Separate the chocolate

# Separate the chocolate

sameerpm + 0 comments In example, all 4 are U (not even one is TT or D)...Then how in o/p you are showing T D and U

josef_klotzner + 0 comments The sample test case is wrong for my understanding:

1 1 1

T

Answer as of test case: 1

Problem description states, to split chocolate in exactly TWO pieces. To give Tom just 1 piece (all) and Derpina nothing is no split at all. (nothing is not a piece)

Correct answer for my understanding: 0

Because it can't be split into "exactly TWO pieces"

What do You think?

kumanoit + 0 comments "The absolute difference between the number of chocolates in pieces should be at most K". Which difference is being referred here? is it Absolute(numberOfChocolates(T) - numberOfChocolates(D)) ?

arpit719 + 0 comments The problem is not explained properly. Also, confusing language is used.

cliftonlboyd + 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 19 Discussions, By:

Please Login in order to post a comment