Write a function that accepts any 2 positive numbers and returns
A number. The function will check if the second number is contained in the first. If so, the function will return the index where the second number appears in the first number (from right to left, index starts from 0), otherwise the function will return -1. It can be assumed that the input is correct (both numbers are positive and whole).
A nested loop is required.
Array not allowed.
Contains (2265123, 651)
Will return 4
Example: 2
Contains (754763, 222)
Will return -1
Orian Aziz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.