6 kyu

Basics 06: Reversing and Combining Text

255 of 1,214smile67

Description:

Your task is to Reverse and Combine Words. It's not too difficult, but there are some things you have to consider...

So what to do?

Input: String containing different "words" separated by spaces

1. More than one word? Reverse each word and combine first with second, third with fourth and so on...
   (odd number of words => last one stays alone, but has to be reversed too)
2. Start it again until there's only one word without spaces
3. Return your result...

Some easy examples:

Input:  "abc def"
Output: "cbafed"

Input:  "abc def ghi 123"
Output: "defabc123ghi"

Input:  "abc def gh34 434ff 55_eri 123 343"
Output: "43hgff434cbafed343ire_55321"

I think it's clear?! First there are some static tests, later on random tests too...

Hope you have fun! :-)

Strings
Arrays
Fundamentals

Stats:

CreatedFeb 8, 2016
PublishedFeb 8, 2016
Warriors Trained3011
Total Skips111
Total Code Submissions6253
Total Times Completed1214
C# Completions255
Python Completions444
JavaScript Completions328
Elixir Completions28
Julia Completions14
Ruby Completions182
Total Stars63
% of votes with a positive feedback rating93% of 272
Total "Very Satisfied" Votes238
Total "Somewhat Satisfied" Votes28
Total "Not Satisfied" Votes6
Ad
Contributors
  • smile67 Avatar
  • myjinxin2015 Avatar
  • docgunthrop Avatar
  • JohanWiltink Avatar
  • Blind4Basics Avatar
  • KenKamau Avatar
  • FArekkusu Avatar
  • felix95 Avatar
  • hobovsky Avatar
  • stellartux Avatar
Ad