6 kyu

Exclamation marks series #15: Replace the pair of exclamation marks and question marks to spaces

82 of 153myjinxin2015
Description
Loading description...
Fundamentals
  • Please sign in or sign up to leave a comment.
  • ahmet_popaj Avatar

    Nice one of the series, congratulations.

  • SerGAD Avatar

    Minus for the fact that the kata does not provide for checking other answer options, subject to the input conditions. For example '! ?? 'wrong, eh'!?? ' right. We have to guess by what scheme the author decided.

  • farhanaditya Avatar

    This comment has been hidden.

  • FaradayLab Avatar

    Confused by this one. From the hardcoded tests:

    '?!!?!!?!!?!!!??!!!??!!!??!!!??!!!??' ----> '?  ?  ?  ?!!!  !!!  !!!  !!!??!!!??'
                  ^    ^    ^    ^    ^                       ^    ^    ^    x    x
    

    Why wouldn't the last two ?? pairs also be removed?

  • phildinius Avatar

    Two people asked this question and I also had trouble figuring this out. You should probably state that "pairs" don't need to be adjacent. Calling it a pair implies (at least to me) that it's one contiguous substring of the input so it would be worth pointing out.

  • dskilly Avatar

    I am confused about one of the tests, replace("!????!!!?") === " ????!!! ", why are the first and last being paired when they should still be grouped up???

  • Blind4Basics Avatar

    missing fixed tests:

    • replace("!!?!!?!!?!!?!!!??!!!??!!!??") => " ? ? ?!!?!!! !!! !!! "
    • replace("??!??!??!??!???!!???!!???!!") => " ! ! !??!??? ??? ??? "
    • for now, there are no fixed tests beginning with ?
    • replace("?!!?!!?!!?!!!??!!!??!!!??!!!??!!!??") => "? ? ? ?!!! !!! !!! !!!??!!!??"

    edit: the note at the end of the description should be removed too

  • G_kuldeep Avatar

    Funtastic kata;-)

  • FArekkusu Avatar

    Python translation. Please, review and approve.

  • StefanPochmann Avatar

    Should "!?!" become " !" or "! "? (edit: that's two spaces each, codewars just sucks there)

  • maiya-22 Avatar

    The instructions need to be more clear. Why wouldn't the result be this: replace("!!!????") === " ?"

  • gabbek Avatar

    There's typo in tag: funcdamentals instead of fundamentals.

  • smile67 Avatar

    Why is replace("!????!!!?") === " ????!!! " (left and right with space), there are no valid pairs?