• take a closer look at the examples in the description, seems that you are missing a part
    edit : i skipped a line in what you posted (remember to mark it as spoiler next time) : try printing the faulty inputs

  • two things :

    1. interesting kata (!)
    2. i like trees
  • description updated.

    thanks!

  • Enjoyed the kata, hadn't heard of the python dataclasses module before this.

    Really small suggestion before the kata comes out of beta:

    In the description, I would change

    # minimal number of sep_hi to be applicated at each side of a word

    to

    # minimum number of sep_hi to be applied to each side of the text in each table cell

    The examples make it clear, but 'each side of a word' makes it sounds like the minimum number of sep_hi should be between every word within a cell.

  • This comment is hidden because it contains spoiler information about the solution

  • Perfect! Thanks

  • now it should be ok for real

  • It is still possible:

    text
    [[], [], [], [], [], [], []]
    style
    Style(off_min=8, sep_he=':', sep_hi=';', sep_ve='|\\', sep_vi='|', align='left')
    Actual:
    ::::
    |\|\
    |\|\
    |\|\
    |\|\
    |\|\
    |\|\
    |\|\
    Expected:
    :::
    |\|\
    |\|\
    |\|\
    |\|\
    |\|\
    |\|\
    |\|\
    

    and

    text
    [[], [], [], [], [], []]
    style
    Style(off_min=1, sep_he='=', sep_hi='@', sep_ve='?', sep_vi='^}}%', align='left')
    Actual:
    ==
    ??
    ??
    ??
    ??
    ??
    ??
    Expected:
    
    ??
    ??
    ??
    ??
    ??
    ??
    
  • i think i will remove the possibility to get such an input because it doesn't make much sense

    then the only "empty input" will be the result of :[[""]]*n (with n==0 -> [])

    good observation, thanks for pointing out !

    regarding the second problem, i guess it's only related to the first one ?

    edit : i fixed it, [[], ..., []] is not possible anymore

  • i said the stuff above to answer RealKenshiro's doubt

    it's not really necessary to change the random test generation.

    The only "issue" with this is that a user with an efficient solution may think wheter he did something wrong or not, seeing such an high time to complete.

    at most you can mention it in the description but it's a minor matter.

  • Question. What should be done when the text is a list of empty lists [[], [], [], []]?
    Sometimes the first line does not cover the width of the next line:

    Actual:
    ////
    [<[<
    [<[<
    [<[<
    [<[<
    [<[<
    [<[<
    Expected:
    ///
    [<[<
    [<[<
    [<[<
    [<[<
    [<[<
    [<[<
    
  • there is to say that by using list.append a list will be reallocated if there is not enough space (O(N)),

    and this is done at worst : (some times) * (3 lists) * (100 test) ("at worst" because there may be some underlying optimizing feature, idk)

    perhaps it could be improved a little generating each list before (knowing its size, like [0]*arrLen)

  • Loading more items...