"A book to train programming skills to fight in the world" Python code answer example --1.2 Count the number of the same characters
import numpy as np
def stringSort(str):
return "".join(sorted(str))
def permutation(str_1,str_2):
if len(str_1) != len(str_2):
return False
return stringSort(str_1) == stringSort(str_2)
input_str_1 = "no"
input_str_2 = "on"
print(permutation(input_str_1,input_str_2))
input_str_3 = "yes"
input_str_4 = "no"
print(permutation(input_str_3,input_str_4))