python-algorithm

백준 11328 Strfry

무적김두칠 2023. 1. 2. 23:44

https://www.acmicpc.net/problem/11328

 

11328번: Strfry

C 언어 프로그래밍에서 문자열(string)은 native한 자료형이 아니다. 사실, 문자열은 그저, 문자열의 끝을 표시하기 위한 말단의 NULL이 사용된, 문자들로 이루어진 문자열일 뿐이다. 하지만 프로그래

www.acmicpc.net

 

1
2
3
4
5
6
7
8
9
10
11
12
13
def sol(s1,s2):
    s1, s2 =sorted(s1), sorted(s2)
    if s1 == s2 :
        return 'Possible'
    else:
        return 'Impossible'
 
if __name__ == '__main__':
    n = int(input())
    for _ in range(n):
        s1, s2 = map(str, input().split())
        print(sol(s1,s2))
        
cs
반응형