6 kyu

Divide into palindromes

129 of 139igorlukjanov05
Description
Loading description...
Algorithms
Fundamentals
  • Please sign in or sign up to leave a comment.
  • dfhwze Avatar

    JS Translation added

  • dfhwze Avatar

    Good kata, but the task description could mean too many different things. What's really bad is that both "smallest" and "largest" are used, but they are to be considered in a different context:

    • "smallest" palindrome within a given division
    • "largest" (of the aforementioned "smallest" palindromes) across all posssible divisions

    Your task is to shuffle and divide this line into the lowest number palindromes so that the length of the smallest palindrome is the largest.

    It would be much better to pick one of the examples in the description, and show us the different divisions, the "smallest" palindrome in each division, and the "largest" of those "smallest" ones.

    I'm logging this as issue, as time and again users have complained about this in the comments and I feel the description is still below par.

  • RealKenshiro Avatar

    Cool and original!

  • JiPiBi Avatar

    Maybe could you improve a bit your description by changing :

    Your task is to shuffle and divide this line into the lowest number palindromes so that the length of the smallest palindrome is the largest
    

    by

    Your task is to shuffle and divide this line into the lowest number of palindromes so that the length of the smallest palindrome is the largest possible : for bcbcccbdcb ,  you can divide it into 2 palindromes and the awaited solution between  d - bbcccccbb and  ccccc-bbdbb , is the second one 
    
  • booniepepper Avatar

    The details really needs some more explanation. It's really only clear what's expected from the examples/test cases.

    E.g. why should I not consider 'aaaaa' as 5 palindromes ('a | a | a | a | a') but as a single 5-length palindrome? There is a rule you're not explaining

  • FArekkusu Avatar

    Fixed tests shouldn't rely on the reference solution.

  • FArekkusu Avatar

    Use random.choices for generating inputs.

  • ilya_plotnikov Avatar

    when a task looks unsolvable it means that's about time to start using math great kata!

  • MarkMoretto Avatar

    If a letter is the smallest palindrome possible, why wouldn't every solution just be 1?

  • KenKamau Avatar

    I'm not sure I understand the task.

    In the example given, the answer is aba|c|ede and the minimum length is 1. Your task is to shuffle and divide this line into a number of palindromes so that the length of the minimum palindrome was the maximum. Maximum of what?

    it would help if you can you give more examples of how you get/split the examples test cases:

    "eutxutuatgextu" =  7
    "abbddc" =  3
    

    Thanks.

  • Blind4Basics Avatar
  • Blind4Basics Avatar

    Hi,

    "caacbbabba"
    10 should equal 5
    

    -> bacabbacab => full length. Either your code is wrong, or there is constraint you didn't talk about in the description.

    Cheers