scala tle


  • 0
    N

    I get TLE in scala, can you point out why?

    return s.split(" ").map(_.reverse).mkString(" ");
    

    while in Python this solution passes

    return ' '.join(map(lambda x:x[::-1], s.split()))
    

    Many thanks


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.