Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def isSubsetArray(ArrayA, ArrayB):
- countSameSubset = 0
- for i_index in range(len(ArrayB)):
- for j_index in range(len(ArrayA)):
- if (ArrayA[j_index].strip().upper() == ArrayB[i_index].strip().upper()):
- countSameSubset += 1
- break
- if (countSameSubset == len(ArrayB)):
- return True
- else:
- return False
- def main():
- StringA = input("Input the 1st Array : ")
- StringB = input("Input the 2nd Array : ")
- isSubsetValue = isSubsetArray(StringA.split(','), StringB.split(','))
- print('isSubset([',StringB.upper(),'], [', StringA.upper(), ']) = ', str(isSubsetValue))
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement