Code 128: TCS NQT - Check Equal Set Characters in two strings | TCS Coding | 365 Days of Code

Опубликовано: 24 Март 2026
на канале: Code House
200
0

Write a program to find whether two given two strings contain equal set of characters or not.

Example 1
Input:
elbow - value of first string
below- value of second string
Output:
1

Example 2:
Input:
nice - value of first string
china- value of second string
Output:
0

In example 1 the first string is "elbow" and the second string is "below" after rearranging the character of "elbow" we will find "below" word hence output is 1

In example 2 the first string is "nice" and the second string is "china", any arrangement of "nice" could not make the word "china" word hence output is 0
"""

str1 = input()
str2 = input()
if sorted(str1) == sorted(str2):
print(1)
else:
print(0)

THanks