Ad
  • Default User Avatar

    You missed the "non-negative integers" requirement.

  • Custom User Avatar

    The reference solution is wrong here: it assumes "full caps" as in "more than 1 character from the beginning of a word is in upper case":

    Super, RANDOMRandom CAPS Super,. seven Benny's Super, Benny's eight?
    
    Expected: 'Repus, Modnarmodnar Spac Repus,. neves S\'ynneb Repus, S\'ynneb thgie?', instead got: 'Repus, MODNARModnar Spac Repus,. neves S\'ynneb Repus, S\'ynneb thgie?'
    
    Super, superCAPS six Carl's. RANDOM Carl's Don't Random, no?
    Expected: 'Repus, SPACrepus xis S\'lrac. Modnar S\'lrac T\'nod Modnar, on?', instead got: 'Repus, spacrEpus xis S\'lrac. Modnar S\'lrac T\'nod Modnar, on?'
    

    It is also wrong in the case a word has an upper case letter in the middle:

    Don't eightMoney Ex Ramses'. super Ramses' Benny's Benny's Random?
    Expected: 'T\'nod yenoMthgie Xe Sesmar\'. repus Sesmar\' S\'ynneb S\'ynneb Modnar?', instead got: 'T\'nod yenomThgie Xe Sesmar\'. repus Sesmar\' S\'ynneb S\'ynneb Modnar?'
    

    (And several more, I stopped trying to list out all of them)

  • Custom User Avatar

    I know this is old, but tbf, I prefer to use linq because of ease of use.

  • Default User Avatar

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

  • Custom User Avatar

    Reraised as issue

  • Custom User Avatar
    • Node 14. should be enabled

    • More sample tests on multiple special characters at end or start should be added

    • There should be 100 random tests at least

    • The description should specify what considers special characters

    • Description should also be reformatted to make example tests clearer

    • The random tests' expected and actual output should not be hidden

  • Default User Avatar

    I like your style.

    I wanna do things without linq but people here only use linq for "one liners".

  • Custom User Avatar

    It would be nice if we could see what is actually expected in the random tests, instead of just wildly guessing what to do with characters like '_' (which should be covered in the description tbh)

  • Custom User Avatar

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

  • Custom User Avatar

    Also, are you sure you need to hide the expected result in the random tests?

  • Custom User Avatar

    Please add all these to the descriptions.

    _ and such are coming out of nowhere, and it's quite painful to get hit by something that you can't see coming ;-)

  • Custom User Avatar

    In the description

    It reverses the words and keeps the location of the uppercase letter the same.

    It is your kata, so you have the right to decide the 'correct' output of these cases
    Here are my opinion
    Dr. Apparently should be coverted to Rd.
    AaaaaB.Ccccc -> Ccccc.bAaaaa, the origin uppercase B is replaced by a uppercase . which is just a .
    iOS Apparently should be coverted to sOI
    co-worker Is - part of a word? If so then rekrow-oc
    ItOUCH macOS XMLHttpRequest -> HcUOTI socAM TSEUqerPtthlmx
    real_pythoner_use_snake_case Is _ part of a word? If so then esac_ekans_esu_renohtyp_laer

    If both -, _ are parts of a word, then what else could be treat as part of a word, or what could not? This should be specified in the description.

    For random test. You could make it tougher if you like
    eg.

    function randomString(len)
    {
    	return [...Array(len)].map(() => Math.random() < .1 ? ' ' : String.fromCharCode(33 + (94 * Math.random() | 0))).join('')
    }
    
  • Custom User Avatar

    I added Random tests. Could you explain the edge cases?

  • Custom User Avatar

    Needs Random Test.
    And some edge cases

    secretConverter('Dr. AaaaaB.Ccccc iOS co-worker ItOUCH macOS XMLHttpRequest')
    secretConverter('real_pythoner_use_snake_case')
    
  • Custom User Avatar

    Smart! You made a loop of the function itself! I was already going through the documentation of C# looking where the hell the method 'Factorial' was. Only to find it being the method we worked in... haha

  • Loading more items...