File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Check Permutation
2+ # Problem Statement
3+
4+ # For a given two strings, 'str1' and 'str2', check whether they are a permutation of each other or not.
5+
6+ # Permutations Of Each Other
7+ # Two strings are said to be a permutation of each other when either of the string's characters can be rearranged
8+ # so that it becomes identical to the other one.
9+
10+ # Example:
11+
12+ # str1= "sinrtg"
13+ # str2="string"
14+
15+ # The character of the first string (str1) can be rearranged to form str2 and
16+ # hence we can say that the given strings are a permutation of each other.
17+
18+ from os import *
19+ from sys import *
20+ from collections import *
21+ from math import *
22+
23+ def isPermutation (string1 , string2 ) :
24+ if sorted (string1 )== sorted (string2 ):
25+ return True
26+ #Your code goes here
27+
28+ #main
29+ string1 = input ()
30+ string2 = input ()
31+ ans = isPermutation (string1 , string2 )
32+ if ans :
33+ print ('true' )
34+ else :
35+ print ('false' )
36+
You can’t perform that action at this time.
0 commit comments