Tap here to switch tabs
Problem
Submissions

Problem: Check If String Is Transformable With Substring Sorts

Try to solve the Check If String Is Transformable With Substring Sorts problem.

Statement

Given two strings s and t, determine whether it is possible to transform s into t by applying the following operation any number of times:

  • Choose any contiguous substring of s and sort its characters in ascending order.

Return true if s can be transformed into t, or false otherwise.

Constraints:

  • s.length ==== t.length

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s and t consist of only digits.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check If String Is Transformable With Substring Sorts

Try to solve the Check If String Is Transformable With Substring Sorts problem.

Statement

Given two strings s and t, determine whether it is possible to transform s into t by applying the following operation any number of times:

  • Choose any contiguous substring of s and sort its characters in ascending order.

Return true if s can be transformed into t, or false otherwise.

Constraints:

  • s.length ==== t.length

  • 1≤1 \leq s.length ≤105\leq 10^5

  • s and t consist of only digits.