7 kyu

Map over a list of lists

110 of 2,183Paul Robertson
Description
Loading description...
Fundamentals
Lists
  • Please sign in or sign up to leave a comment.
  • eb110 Avatar

    JS -> the original array shouldn't be mutated.

  • swientzek Avatar

    This comment has been hidden.

  • heppleton Avatar

    I'm trying to learn Java and came across this kata. I was daunted by the syntax in the problem which I had never seen before. But I sat down, looked up the unknowns bit by bit, trying to understand what the problem was asking and how I might solve it.

    Despite my best efforts I couldn't get anywhere close. Not just a bad solution, or a partial one, I simply couldn't write an answer which even ran. I know a little bit more about Function, lambda, and generics, but my confidence kinda took a hit.

    Maybe this kata is totally misranked and should be much higher, or it just needs more explanation, or I'm a complete idiot. It could be the latter, I'm willing to admit that, but it feels like something is off with this kata.

  • user7607088 Avatar

    Very poor description. Basically it ask you to map 'xss' with 'fn' condition.

  • dfhwze Avatar

    Ruby: is it possible to add a custom error message that includes the input?

  • swientzek Avatar

    This comment has been hidden.

  • dfhwze Avatar

    This kata reminds me why I favour C# over Java.

  • Nibir1607 Avatar

    nice one..thank you

  • dinglemouse Avatar

    The Java initial solution signature is wrong.

    public static <T,R> List<List<R>> gridMap(Function<T,R> fn, List<List<T>> list){
    

    Should be

    public static <T,R> R[][] gridMap(Function<T,R> fn, T[][] list)
    
  • turbalan Avatar

    This comment has been hidden.

  • JohanWiltink Avatar
  • FArekkusu Avatar

    Trivial map/filter/reduce is not a novel kata idea.

  • JohanWiltink Avatar

    Write a function gridMap (grid_map in Python) which applies a function to a list of lists:

    Wouldn't ".. which maps a function over the lists in a list" be more correct?

    If I read the current description literally, I should apply the function to the outer list, not map it over the inner lists.

  • SergeySinyavskiy Avatar
  • FArekkusu Avatar

    Trivial map/filter/reduce is not a novel kata idea.

  • JohanWiltink Avatar

    There are some suggestions for the tests in this fork. Readability really is a thing for tests - some day, someone ( and that someone might be you! ) might have to maintain that code.

    ( My vote is actually not because of that; I just think the subject matter is mighty thin to make a kata out of. My perspective on that may be skewed; that'll average out with other opinions then. )