Question
in python code Write a function called isSubset() that receives two integers and returns if any of them is a subset of the other. An
in python code
Write a function called isSubset() that receives two integers and returns if any of them is a subset of the other. An integer is said to be a subset of the other if every digit in the first appears somewhere in the second. The function returns 1 if the first is a subset of the second, 2 if the second is a subset of the first and 0 if both are subset of the other. If none of them is a subset of the other, then the function returns -1.
For example: isSubset(124, 24) returns 2
isSubset(124, 4120) return 1
isSubset(240, 124) returns -1
isSubset(124, 421) returns 0
isSubset(112233, 1234) returns 1
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started