text: we are splitting the input based on spaces ( s ) + : this regular expression will handle scenarios where we have words separated by multiple spaces
code: String s [ ] = input . split ( " ( \\ s ) + " ) ; for ( String values : s ) {