add a resursive solution, TLE