Arrange W, D, and L Results into Repeated WDL Groups
Given a string s consisting only of W, D, and L (win, draw, and loss), rearrange its characters as follows:
- While at least one
W, oneD, and oneLremain, appendWDLto the result....
Example
Unlock to view complete problem details
and practice with sample input/output
Was this article helpful?
View Test Cases & Run Code requires membership
Standard Input
Execution Result:
