+ 6
Challenge 13: Yet another String Reversal.
Write a program to input a string consisting of more than one word. Reverse the words without changing their order. Example: Sample Input: Amrit Mahendra Joseph Sample Output: tirmA ardnehaM hpesoJ A word is any set of characters separated by a space or any non alphanumeric character. Best of Luck!
22 Antworten
+ 3
Here you go
https://code.sololearn.com/ct3PKj926160/?ref=app
+ 8
Here is mine, it's updated:
https://code.sololearn.com/wbvChRkyPm9O/?ref=app
+ 7
A oneliner solution:
https://code.sololearn.com/ccXcPpD3ffVn/?ref=app
+ 5
https://code.sololearn.com/c8JJGKpfmEbg/?ref=app
+ 4
Code updated..
https://code.sololearn.com/WT3vOl96qAZS/?ref=app
+ 3
@Vengat, maybe it is..
Let's make it hard..
Check it now...
+ 3
Code updated. Now works
+ 3
@Vari93 Don't Spam here, compress your replies into one post ! And there is no objections on reversing Symbols according to challenge.
+ 3
I think @Vari93 is on the right track.
+ 3
@Amrit but you didn't mentioned it earlier and till now !
+ 2
@Empty so does yours
+ 2
feature added 👌
https://code.sololearn.com/W5ScWQu3K68x/?ref=app
+ 1
@Vengat yours reverses the whole string. semi-colons and end of sentence symbols (./?/!) remain in their spots
+ 1
@Ekansh and so does yours
+ 1
@Calvin yours deletes them completely.
+ 1
@Ekansh Yeah there is, he defined words as a sequence of characters separated by a space, semi-colon (;) and complete stops (./?/!).
+ 1
this is the SHORTEST one liner solution...
https://code.sololearn.com/cGCz34X4qs06/?ref=app
+ 1
@Ekansh, maybe Vari is right.
To speak on the language of Java, you have to use any non alphanumeric character as delimiter and make it remain in its own position...
And @Vari, please compress your replies into one post as Ekansh specified...
^_^