Add the count of sticks required to represent the current character
if ( ch >= ' ' && ch <= ' ' ) { cnt += sticks [ ch . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] ; } else { cnt += number [ ch . charCodeAt ( 0 ) - ' ' . charCodeAt ( 0 ) ] ; } } return cnt ; }