Reverse Sentence By Words - Logic Building Practice

  Рет қаралды 22,199

CloudTech

CloudTech

Жыл бұрын

In this video, we showed how to reverse a sentence by words.
Input : "Welcome to CloudTech"
Output : "CloudTech to Welcome"
#java
#javainterviewquestions
#javacoding

Пікірлер: 32
@proxy5061
@proxy5061 Жыл бұрын
Great bro, I thot same logic before clicking on vedio , please bring more on same level
@bhargavi4557
@bhargavi4557 9 ай бұрын
How to do this in java8
@mohanrajdandy
@mohanrajdandy Жыл бұрын
I have one string called mohan@raj which is the input and the output should be raj@mohan. Can you please write the logic for this
@swabhaviwagh2718
@swabhaviwagh2718 Жыл бұрын
For loop will execute 3times
@animeshnaik2345
@animeshnaik2345 Жыл бұрын
3 times?
@gopalkannan4934
@gopalkannan4934 Жыл бұрын
Thank you!!
@chandan07talreja
@chandan07talreja Жыл бұрын
Can you upload a similar video using streams and not using the default reverse order method available in streams.
@ripusudansoni3366
@ripusudansoni3366 Жыл бұрын
3
@VikashYadav-px8ei
@VikashYadav-px8ei Жыл бұрын
3 times
@GoogleAccount-ph8mm
@GoogleAccount-ph8mm Жыл бұрын
Please put java program using dynamic programming
@harshavanama4388
@harshavanama4388 Жыл бұрын
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)
@abhinandeshwar6335
@abhinandeshwar6335 Жыл бұрын
Hi, harsha, Then you'll have changes in split condition right?
@harshavanama4388
@harshavanama4388 Жыл бұрын
@@abhinandeshwar6335 split won't work here. It's a more complicated solution
@nayyarrabbani8518
@nayyarrabbani8518 Жыл бұрын
@@harshavanama4388 And do you know how to solve that problem ? If yes, can you drop down any reference.!
@harshavanama4388
@harshavanama4388 Жыл бұрын
Well I am thinking of using couple of arrays and add words in one array and symbols in another one and then finally merging both of those arrays, one should be reversed(words array). But thats just my idea, I have to write code and see if it works or not
@nayyarrabbani8518
@nayyarrabbani8518 Жыл бұрын
@@harshavanama4388 Great one brother, are you on linkedin.?
@AK-fh8tg
@AK-fh8tg Жыл бұрын
5
@proxy5061
@proxy5061 Жыл бұрын
Noo 3
@maharudra947
@maharudra947 Жыл бұрын
5 = 3 words + 2 spaces
@Praveenkumar-hg9ir
@Praveenkumar-hg9ir Жыл бұрын
No, its wrong.. for loop run for N times, where N is length of words - so, it is 3
@chetansinghphogat3195
@chetansinghphogat3195 Жыл бұрын
5 (Beacuse of appending space)
@cloudtech5260
@cloudtech5260 Жыл бұрын
Hi Chetan, It is 3, as we have 3 words in the sentence.
@mominuber
@mominuber Жыл бұрын
//Le javascript let str=prompt("Enter a string to reverse") console.log(str.split(' ').reverse().join(' '));
@SahanasAllinOneChannel
@SahanasAllinOneChannel 5 ай бұрын
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]); } System.out.println(sj.toString());
@batlanki-jj7ht
@batlanki-jj7ht Жыл бұрын
3
@VirtualPopsterofficail
@VirtualPopsterofficail 6 ай бұрын
3 times
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 65 МЛН
Gym belt !! 😂😂  @kauermtt
00:10
Tibo InShape
Рет қаралды 16 МЛН
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 62 МЛН
ПРОВЕРИЛ АРБУЗЫ #shorts
00:34
Паша Осадчий
Рет қаралды 6 МЛН
Reverse Each Word In Given String | Java | Ashok IT
12:24
Ashok IT
Рет қаралды 37 М.
How to Find Duplicate Words in a String in Java | Coding Skills
24:36
Reverse Words in a String | LeetCode 151 | C++, Java, Python
13:58
Knowledge Center
Рет қаралды 171 М.
Java Program to Reverse each Word of a String
5:49
Programming Tutorials
Рет қаралды 86 М.
Learn Java in 14 Minutes (seriously)
14:00
Alex Lee
Рет қаралды 4,6 МЛН
Solve String Programs in Java
14:37
Simply Coding
Рет қаралды 82 М.
Who has won ?? 😀 #shortvideo #lizzyisaeva
00:24
Lizzy Isaeva
Рет қаралды 65 МЛН