+ 4
Condense strings challenge
I came up with the idea of this challenge online and I thought I could post it here. User inputs a sentence (string), each word separated with a space. The program outputs a new string with the words condensed. Now what does condensing mean? If you take two words, and the ending of the first one is the same as the beggining of the second one, they are merged together into a new word. Examples: Input: "Live verses" Output: "Liverses" Input: "No one ever runs so often" Output: "Noneverunsoften" Enjoy!
13 odpowiedzi
+ 6
If the string contains duplicated strings adjacently placed? Ex: "string string"
+ 6
Well I did this
https://code.sololearn.com/cqENT1wJAM74/?ref=app
+ 4
Is this right ? ^_^
https://code.sololearn.com/czqjem709OXr/?ref=app
+ 4
@Augustas No, good explanation but Im french. https://code.sololearn.com/c9PofK7MaaGJ/?ref=app
+ 3
@clement
Once more it isn't perfect: if I input "live verses", it outputed the same thing, "live verses", when it should be "liverses"
+ 2
Also check out my own Tic Tac Toe game:
https://code.sololearn.com/WtKc34f0gtbz/?ref=app
Best of luck coders!
+ 2
7 lines :))
https://code.sololearn.com/c9PofK7MaaGJ/?ref=app
+ 2
@Ekansh kashyap
Nope, read the rules: if the ending of one word is the same as the beggining of the second one, the ending of the first word is deleted and then the two words are merged together
+ 2
@clement
Congratulations, we have a winner, just tested it, everything works just fine :)
+ 1
@J.G. One of them gets deleted
+ 1
@clement Nice try, but it isn't yet perfect ;)
My input was no one ever runs so often, and output was none everuns soften, when it should be noneverunsoften. Good luck improving it
+ 1
@clement
Yeah, my explanation wasn't so good too :/
0
@/* S Vengat */
Haha, it's a good start though :)