recursively find all qualified substrings
add comments for sol
sol of q131