If we have reached the end of the string , return the subsequence if it is valid , else return an empty list
int len = str . length ( ) ; if ( index >= len ) { if ( isValidSequence ( subList ) ) return subList ; else return " " ; }