1585. Check If String Is Transformable With Substring Sort Operations
Given two strings s and t, transform string s into string t using the following operation any number of times:
- Choose a non-empty substring in s and sort it in place so the characters are in ascending order.
- For example, applying the operation on the underlined substring in “14234” results in “12344”.
Return true if it is possible to transform s into t. Otherwise, return false.
A substring is a contiguous sequence of characters within a string.
1 | class Solution { |