Wednesday, July 9, 2008

Given a string"My name is Girish" write a code snippet to make it "Girish is name My" (one of the optimistic ways)

This is a 2 step process:
Step 1 : Reverse the whole string "My name is Girish". It becomes "hsiriG si eman My".
Step 2: Reverse each word which makes it "Girish is name My".

Complexity: SIMPLE.

No comments: