bool isLongPressedName(char * name, char * typed){ if (*name++ != *typed++) return false; while(*name || *typed) { if (*typed++ == *name) name++; if (*typed != *(typed-1) && *typed != *name) return false; } return true; }