Question
A number n is said to contain the number m if all the digits of m appear in the number n in the same order
A number n is said to contain the number m if all the digits of m appear in the number n in the same order and sequence. For example, if n = 12345 then it contains for example the following numbers - 1, 12, 345, 234 (and many others). But it does not contain 235 because those digits are not in sequence in it. Note that each number contains itself. Write a recursive method whose signature - public boolean contains(int n, int m) The method will accept as parameters two numbers, n, m, and will return true if n contains m as described. Do not use loops at all in this question! It is allowed to define private helper methods
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