Two integers a and b given we are intresed in postions
Answers
Hey mate...
The decimal zip of two non-negative integers A and B is an integer C whose decimal representation is created from the decimal representations of A.
I hope it's helpful..
please mark me as brainliest...
Two integers a and b given we are intresed in postions
• Two integers A and B are given. We are interested in positions at which the decimal representation of A occurs as a substring in the decimal representation of B (counting from 0).
• For example: O
• 53 occurs in 1953786 at position 2.
• 78 occurs in 195378678 at positions 4 and 7.
• 57 does not occur in 153786.
• Decimal representations are assumed to be big-endian and without leading zeros (the only exception being the number 0, whose decimal representation is "0").
• Write a function def solution (A, B) that, given two integers A and B, returns the leftmost position at which A occurs in B.
• The function should return -1 if A does not occur in B. For example, given A = 53 and B = 1953786, the function should return 2, as explained above.
= Assume that:
• A and B are integers within the range [0..999,999,999]. In your solution, focus on correctness.
• The performance of your solution will not be the focus of the assessment.
#SPJ3