Function to check if a string is of the form odd even odd even ...
function isOddEvenForm ( s ) { let n = s . length ; for ( let i = 0 ; i < n ; i ++ ) { if ( i % 2 == 0 && s [ i ] % 2 != 1 ) return false ; if ( i % 2 == 1 && s [ i ] % 2 != 0 ) return false ; } return true ; }