Answered step by step
Verified Expert Solution
Question
1 Approved Answer
need help solving this in java An online shop sells T-shirts of three sizes: S (small), M (medium) and L (large). Write a function solution
need help solving this in java
An online shop sells T-shirts of three sizes: S (small), M (medium) and L (large). Write a function solution that, given a string T of length N containing letters S, M and L, returns a sorted string T by T-shirt sizes from the smallest to the largest. Examples: 1. Given T = "MSSLS", the function should return "SSSML". 2. Given T = "LLMS", the function should return "SMLL". 3. Given T = "SMS", the function should return "SSM". Write an efficient algorithm for the following assumptions: N is an integer within the range (1..200,000): string T consists only of the following characters: "s", "M" and/or "LStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started