• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests
September 15, 2023 |2.7K Views
SDE Sheet - Reverse words in a given string
  Share  1 Like
Description
Discussion

This video is part of the Strings section in the GFG SDE Sheet.

Given a String S, reverse the string without reversing its individual words. Words are separated by dots.

Example :

Input:
S = i.like.this.program.very.much
Output: much.very.program.this.like.i

Explanation: After reversing the whole string (not individual words), the input string becomes much.very.program.this.like.i

Try it out before watching the implementation of the problem in the video. We recommend watching the video, even if you can solve the problem. You may discover something new. All the best!!!

Do check out:-

Article: https://www.geeksforgeeks.org/reverse-words-in-a-given-string/
Problem: https://practice.geeksforgeeks.org/problems/reverse-words-in-a-given-string5459/1
SDE Sheet: https://www.geeksforgeeks.org/sde-sheet-a-complete-guide-for-sde-preparation/

Read More