LeetCode
LintCode 211 String Permutation - Easy
211. String Permutation
211. String Permutation — Easy
Problem
- String Permutation
Given two strings, write a method to decide if one is a permutation of the other.
Example Example 1: Input: "abcd", "bcad" Output: True
Example 2: Input: "aac", "abc" Output: False
Solution
class Solution:
"""
@param A: a string
@param B: a string
@return: a boolean
"""
def Permutation(self, A, B):
# write your code here
A = sorted(A)
B = sorted(B)
return A==B