Driver Code to test above functions
let L = 1 , R = 1000 ; K = 3 ; document . write ( ( countInRange ( R ) - countInRange ( L - 1 ) ) + " " ) ; L = 9995 ; R = 10005 ; K = 2 ; document . write ( ( countInRange ( R ) - countInRange ( L - 1 ) ) + " " ) ;