bugl
bugl
HomeLearnPatternsPathsSearchPremium
HomeLearnPatternsPaths
EasyTwo PointersLC 557

Reverse Words in a String III

Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order.

Asked at 9 companies
AmazonAppleBloomberg
Hints
  • 1.Think about which data structure fits best
  • 2.Consider the time complexity of your approach
  • 3.Look for patterns in the constraints
LeetCode