JavaScript program for the above approach
let M = 1000000007 ; function waysOfDecoding ( s ) { let first = 1 , second = s [ 0 ] == ' ' ? 9 : s [ 0 ] == ' ' ? 0 : 1 ; for ( let i = 1 ; i < s . length ; i ++ ) { let temp = second ;