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 Жыл бұрын
Great bro, I thot same logic before clicking on vedio , please bring more on same level
@bhargavi45579 ай бұрын
How to do this in java8
@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 Жыл бұрын
For loop will execute 3times
@animeshnaik2345 Жыл бұрын
3 times?
@gopalkannan4934 Жыл бұрын
Thank you!!
@chandan07talreja Жыл бұрын
Can you upload a similar video using streams and not using the default reverse order method available in streams.
@ripusudansoni3366 Жыл бұрын
3
@VikashYadav-px8ei Жыл бұрын
3 times
@GoogleAccount-ph8mm Жыл бұрын
Please put java program using dynamic programming
@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 Жыл бұрын
Hi, harsha, Then you'll have changes in split condition right?
@harshavanama4388 Жыл бұрын
@@abhinandeshwar6335 split won't work here. It's a more complicated solution
@nayyarrabbani8518 Жыл бұрын
@@harshavanama4388 And do you know how to solve that problem ? If yes, can you drop down any reference.!
@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 Жыл бұрын
@@harshavanama4388 Great one brother, are you on linkedin.?
@AK-fh8tg Жыл бұрын
5
@proxy5061 Жыл бұрын
Noo 3
@maharudra947 Жыл бұрын
5 = 3 words + 2 spaces
@Praveenkumar-hg9ir Жыл бұрын
No, its wrong.. for loop run for N times, where N is length of words - so, it is 3
@chetansinghphogat3195 Жыл бұрын
5 (Beacuse of appending space)
@cloudtech5260 Жыл бұрын
Hi Chetan, It is 3, as we have 3 words in the sentence.
@mominuber Жыл бұрын
//Le javascript let str=prompt("Enter a string to reverse") console.log(str.split(' ').reverse().join(' '));