Reverse Sentence By Words - Logic Building Practice

preview_player
Показать описание
In this video, we showed how to reverse a sentence by words.

Input : "Welcome to CloudTech"
Output : "CloudTech to Welcome"

#java
#javainterviewquestions
#javacoding
Рекомендации по теме
Комментарии
Автор

String s="Welcome to CloudTech";
String[] sArray=s.split(" ");
StringJoiner sj=new StringJoiner(" ");
for(int i=sArray.length-1; i>=0;i--) {
sj.add(sArray[i]);
}

SahanasAllinOneChannel
Автор

solve more complicated problem, like for example Welcome, to+CloudTech!All. String should return All, CloudTech+to!Welcome(only worlds should reverse special characters should remain at the same position)

harshavanama
Автор

Great bro, I thot same logic before clicking on vedio, please bring more on same level

proxy
Автор

Can you upload a similar video using streams and not using the default reverse order method available in streams.

chandantalreja
Автор

Please put java program using dynamic programming

GoogleAccount-phmm
Автор

//Le javascript
let str=prompt("Enter a string to reverse")

console.log(str.split(' ').reverse().join(' '));

mominuber