1 line java


  • 0
    L
    public class Solution {
        public String reverseWords(String s) {
           return Stream.of(s.split(" ")).map(a -> new StringBuilder(a).reverse().toString()).collect(Collectors.joining(" "));
        }
    }
    

Log in to reply
 

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