Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Problem 171. Reverse the Words (not letters) of a String

Created by @bmtran


Change the words of a string such that the words appear in reverse order. You may assume that the string is a number of words split by a single space character. The only characters in the input are letters and spaces.


   input = 'Will the ecological jail rule outside the tear';
   output = 'tear the outside rule jail ecological the Will';


Problem Group

Solution Statistics

117 correct solutions 80 incorrect solutions
Last solution submitted on Sep 17, 2015

Problem Comments