If ' y ' appears after ' x ' every sub - string ending at an ' x ' appearing after this ' y ' and starting with the current ' x ' is a valid sub - string
else : NEW_LINE INDENT count += countX [ nextIndexY ] NEW_LINE DEDENT