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.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Prepare
  2. Algorithms
  3. Dynamic Programming
  4. Separate the chocolate
  5. Discussions

Separate the chocolate

Problem
Submissions
Leaderboard
Discussions
Editorial

Sort 21 Discussions, By:

recency

Please Login in order to post a comment

  • thecodingsoluti2
    4 months ago+ 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|
    Permalink
  • rohitgowan123
    2 years ago+ 0 comments

    not passing the value of k... to define the max differnce b/w pieces..

    0|
    Permalink
  • pratik107
    2 years ago+ 0 comments

    can't understand the meaning of the question.... plz help....

    0|
    Permalink
  • arpit719
    3 years ago+ 0 comments

    The problem is not explained properly. Also, confusing language is used.

    0|
    Permalink
  • cliftonlboyd
    3 years ago+ 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

    0|
    Permalink
Load more conversations

Need Help?


View editorial
View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy