LeetCode-Solutions
LeetCode-Solutions copied to clipboard
added python solution for 151. reverse words in a string
Description
The question is to reverse the order of the words in a string. There may be multiple whitespaces between words, but the output should only contain one. Python's split() takes care of most of the work nicely, and the resultant list is reversed via splicing and converted back to a string with join().
Put check marks:
Have you made changes in README file ?
- [x] Added problem & solution under correct topic.
- [x] Specified Space & Time complexity.
- [x] Specified difficulty level, tag & Note(if any).
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.
- [x] Leetcode provided tests
Make sure all below guidelines are followed else PR will get Reject:
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code so that it is easy to understand
- [x] I have made corresponding changes to the documentation
- [x] My changes generate no new warnings
- [x] Any dependent changes have been merged and published in downstream modules
I can tell this is your first pull request! Thank you I'm so honored. :tada::tada::tada: I'll take a look at it ASAP!