@@ -0,0 +1,809 @@
+package com.sunny.grokkingalgorithms.boot2019.toast;%0A%0Aimport java.util.Scanner;%0A%0Apublic class ReverseSentence %7B%0A%0A    /*%0A    Sample Input%0A%0AI am an Indian%0A%0ASample Output%0A%0AIndian an am I%0A     */%0A%0A    public static String reverseSentence(String line)%7B%0A        StringBuilder reversed = new StringBuilder();%0A        String%5B%5D splitted = line.split(%22%5C%5Cs+%22);%0A        String%5B%5D spaces = line.split(%22%5C%5Cw+%7C%5C%5Cp%7BPunct%7D%22);%0A        int j = 0;%0A        for(int i = splitted.length - 1 ; i %3E= 0 ; i--)%7B%0A            reversed.append(splitted%5Bi%5D);%0A            reversed.append(%22 %22);%0A        %7D%0A        return reversed.toString();%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Scanner scanner = new Scanner(System.in);%0A        String line = scanner.nextLine();%0A        System.out.println(reverseSentence(line));%0A    %7D%0A%0A%7D%0A

Reverse sentence sub optimal.