Scrambled string
Your task
A string can be 'scrambled' by recursively splitting it into two non-empty parts and optionally swapping them, applying this to either part. Given strings s1 and s2 of equal length (1 <= len <= 30, lowercase letters), return True if s2 is a scramble of s1.
Examples
is_scramble(s1: str, s2: str) -> boolExample 1
Input
is_scramble("great", "rgeat")Output
True