7 kyu

Normalize the jagged array

Description
Loading description...
Arrays
  • Please sign in or sign up to leave a comment.
  • heroicfun Avatar

    Approved it as 7 kyu.

  • Yushi.py Avatar

    Feels like a 2016 kata, lol

  • rsalgado Avatar

    Nice kata! Hope it gets approved soon.

  • LS2008 Avatar

    nice kata, the only suggestion I could give is maybe don't stuck the fill_value only to None? But can be more customed? thanks

  • Blind4Basics Avatar

    This comment has been hidden.

  • hobovsky Avatar

    This suggestion reraised as an issue:

    It needs to be considered and explained how this kata is meant to be translated to strongly typed languages.

    Design-wise, I think it would be much nicer if the filling value was passed in as a parameter, potentially with a default value of "no value" in languages which allow for this. So in Python, the function would be def normalize(arr, fill_with=None). This would make translation to strongly typed languages like C++, Java, Scala, Haskell, much easier.

  • ejini战神 Avatar

    This part still should be language-agnostic Implement a function normalize(arr) that takes a jagged array as an input and outputs its normalized version. ( by removing normalize(arr) since function and parameter names differ among languages, users can view them in trainer so no need to mention them explicitly)

  • ejini战神 Avatar

    Description should be language-agnostic Implement a function normalize(arr) that takes a jagged array as an input and outputs its normalized version. && the usage of None in the examples (should mention None / nil / null depending on your language)

  • hobovsky Avatar

    It would be already worth to consider, and potentially suggest somewhere, somewhow (maybe even in an answer to this comment) how this kata is meant to be translated to strongly typed languages.

    Design-wise, I think it would be much nicer if the filling value was passed in as a parameter, potentially with a default value of "no value" in languages which allow for this. So in Python, the function would be def normalize(arr, fill_with=None). This would make translation to strongly typed languages like C++, Java, Scala, Haskell, much easier.

  • Kacarott Avatar

    Surely the result for input [] should be []? I don't understand how you get [[]].

  • Just4FunCoder Avatar

    Random tests are susceptible to input mutation.

    Example

  • Voile Avatar

    There should be a test case of an empty array (N = 0 is perfectly valid as input). Some solutions will break in this case.