Find common characters to help me fix my python code. Thank you. https://www.hackerrank.com/contests/filter-ece-1/challe
Posted: Sun May 15, 2022 11:56 am
Find common characters to help me fix my python code.
Thank you.
https://www.hackerrank.com/contests/fil ... rs/problem
s1=input()
s2=input()
a=list(set(s1)&set(s2))
for i in (a):
print(i,"", end="")
Read two strings from user. Identify the characters that are present in both the strings. Display these common characters. Input Format Submissions: 21 Max Score: 100 Difficulty: Hard Rate This Challenge: 2 character arrays Output Format More characters Sample Input elephant ear Sample Output ea Explanation Extract each character from the second string. Search for that character in the first string. If there are no common characters, print the message "no common characters". The letters in the output need to occur only once Python 3 1 2 1 input() 32 input) a=list(set(1)&set (52)) 5 for 1 in (a): print(1,"", end 7 Line: 1 Col: 1 Upload Code as File Test against custom input Run Code Submit Code Testcase 0 o Testcase 1 x 1 Your code did not pass this test case. Input (stdin) describe different Your Output (stdout) Expected Output dier
Thank you.
https://www.hackerrank.com/contests/fil ... rs/problem
s1=input()
s2=input()
a=list(set(s1)&set(s2))
for i in (a):
print(i,"", end="")
Read two strings from user. Identify the characters that are present in both the strings. Display these common characters. Input Format Submissions: 21 Max Score: 100 Difficulty: Hard Rate This Challenge: 2 character arrays Output Format More characters Sample Input elephant ear Sample Output ea Explanation Extract each character from the second string. Search for that character in the first string. If there are no common characters, print the message "no common characters". The letters in the output need to occur only once Python 3 1 2 1 input() 32 input) a=list(set(1)&set (52)) 5 for 1 in (a): print(1,"", end 7 Line: 1 Col: 1 Upload Code as File Test against custom input Run Code Submit Code Testcase 0 o Testcase 1 x 1 Your code did not pass this test case. Input (stdin) describe different Your Output (stdout) Expected Output dier