Skip to content

Commit db368f0

Browse files
committed
first commit
1 parent bdd0176 commit db368f0

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

check_permuation.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+

0 commit comments

Comments
 (0)