• + 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