Question: I want to find out if one string is equal to at least one of the permutations of the other string.
For example, the output of the following two comparisons must be `true`:

```
print('united states of America' == 'America united states of')
print('united states of America' == 'states of united America')

```

I used the `itertools.permutations` method to find permutations, but
I want it for words not the sentence nor the letters in the string.

So not `'abcd' == 'bcad'` equals `True`, but `'a b c d' == 'b c a d'`
should be `True`.

Answer: 
You do not need `itertools.permutations`. Instead, compare *reordered* strings, with all words sorted:

```
def reorder_str(s):
    return " ".join(sorted(s.split()))

print(reorder_str('united states of America') == reorder_str('America united states of'))
# True

print(reorder_str('united states of America') == reorder_str('america united states of'))
# False

```
A computationally more efficient way of doing it compared to permutations would be to split and sort the strings and compare the sorted lists. A challenge with generating permutations is that as soon as you start getting just a couple of words, e.g. 10, then you would have 10! number of permutations (3628800) generated which you would compare your string against making it very inefficient very fast.

```py
string_1 = "states of united America"
string_2 = "united states of America"

def check_if_perm(s1, s2):
    return sorted(s1.split()) == sorted(s2.split())

```

outputs:

```
True

```