Function to check if a numeric string can be split into substrings such that the difference between the consecutive substrings is K
function isPossible ( s , K ) { let valid = false ; let firstx = - 1 ;