Sum of the Asked Digits
Write a Java program to calculate the sum of every mth and kth digit in the given number. The input consists of a single integer 'n' which corresponds to the given number. In case if k or m is greater than the number of digits present in n, print -1.
Input Format:
Integer n
Integer m
Integer k
Code Constraints:
0 < Number of digits in the given number n < 10000
Sample Testcases:
Input 1:
123456
Output 1:
15