Set states according to the input characters in the string and the rule defined in the description . If current character is [ A - Z ] . Set current state as 0.
if ( str [ index ] >= ' A ' && str [ index ] <= ' Z ' ) curr_state = 0 ;