Skip to content

Solution #151- Abdul Wahab - 13/07/2025 #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AbdulWahab938
Copy link
Contributor

@AbdulWahab938 AbdulWahab938 commented Jul 14, 2025

This PR adds a solution for Leetcode Problem: Reverse Words in a String.
The goal is to reverse the order of words in a given string such that words are separated by a single space, with no leading or trailing spaces.
The approach parses the input string, extracts words, and reconstructs the result in reversed order, ensuring extra spaces are removed and only single spaces separate the words.
An in-place, optimized solution is included that efficiently reverses word order without using additional data structures like a stack.

@AbdulWahab938 AbdulWahab938 changed the title Reverse words in a String Reverse words in a String 13-07 Jul 14, 2025
@AbdulWahab938 AbdulWahab938 changed the title Reverse words in a String 13-07 #2 - Reverse words in a String -medium Jul 17, 2025
Copy link
Member

@JRS296 JRS296 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly use the template and fix the naming of the files (examplanation.md and file name)

@AbdulWahab938 AbdulWahab938 changed the title #2 - Reverse words in a String -medium #2 - Reverse words in a String - Medium Jul 19, 2025
@AbdulWahab938 AbdulWahab938 changed the title #2 - Reverse words in a String - Medium Solution #151- Reverse words in a String - Medium Jul 19, 2025
@AbdulWahab938 AbdulWahab938 force-pushed the feature/reverse-words-string branch from 49a4899 to 773f2fd Compare July 19, 2025 10:41
@AbdulWahab938
Copy link
Contributor Author

Kindly use the template and fix the naming of the files (examplanation.md and file name)

Hi Jonathan, thanks for reviewing my PR. Could you please re-review it. I have combined your existing java solution and my cpp and python solution along with the updated Explanation

@AbdulWahab938 AbdulWahab938 changed the title Solution #151- Reverse words in a String - Medium Solution #151- Abdul Wahab - 13/07/2025 Jul 19, 2025
@AbdulWahab938 AbdulWahab938 requested a review from JRS296 July 19, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants