log in
About and Contact
© 2020 DOUBTCOOL
Python code:-
def FindIntersection(strArr):
val=[]
a=list(set(strArr[0].split(",")))
b=list(set(strArr[1].split(",")))
for i in range(len(a)):
a[i]=int(a[i])
for j in range(len(b)):
b[j]=int(b[j])
for i in range(len(a)):
for j in range(len(b)):
if(a[i]==b[j]):
val.append(a[i])
val=list(set(val))
val.sort()
if len(val) == 0:
return False
else:
return ",".join([str(i) for i in val])
# code goes here
# keep this function call here
print(FindIntersection(input()))
Program is correct output error
Check your indentations(i.e spacing
before each)
Have the function
ArrayChallenge
(strArr) read the
array of strings
stored in strazz which
will contain 2 strings
representing two
comma separated
lists of keypresses.
Your goal is to return
the string true if the
keypresses produce
the same printable
string and the string
false if they do not. A
keypress can be either
a printable character
or a backspace
represented by -B.
You can produce a
printable string from
such a string of
keypresses by having
backspaces erase one
preceding character.