this is recursive answer, very similar to permutation, time limit error