1. You are given two strings s1 and s2. 2. A string can be represented as a binary tree by partitioning it to two non-empty substrings recursively. 3. If you choose any non-leaf node and swap its two children, then the string formed is the scramble of the original string. 4. You have to determine if s2 is a scrambled string of s1. <img src="http://pepcoding.com/resources/ojquestionresource/images/scramblestring.jpeg" style="width:550px">
Input Format
2 strings s1 and s2
Output Format
Check the sample output and question video.
Constraints
1 < length of strings <= 100
Notice
Try First, Check Solution later
1. You should first read the question and watch the question video.2. Think of a solution approach, then try and submit the question on editor tab.3. We strongly advise you to watch the solution video for prescribed approach.Example
Input
great rgeat
Output
true