Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Systems A 360-degree Approach

Authors: Jawwad ShamsiMuhammad Khojaye

1st Edition

0429531575, 9780429531576

More Books

Students also viewed these Databases questions

Question

Define and describe the sections in a job description.

Answered: 1 week ago