positive number n. The position of the digit is counted from the right and starts from 1. If the required

digit is not in the number, the method should return -1. For example, position(12315, 1) returns 2 and

position(12, 3) returns -1. No error checking on the parameters is required in the method. The method

header is given below:

public static int position(int n, int digit)

Test cases: (1) n : 12345, digit : 3; (2) n : 123, digit : 4; (3) n : 12145, digit : 1;

Expected outputs: (1) position = 3; (2) position = -1; (3) position = 3.

0