Plz reduce the complexity of my code.my output is correct

hi i saw your code earlier also…see you are doing alot of redundant work…you are trying to generate all permutations of the n digit numbers…the trick is to find a pattern corresponding to the input n…try generating the pattern by taking different values of n…you will find that you are getting the fibonacci pattern…so this code reduces to just print the fibonacci number accordingly…

your logic is fine too but when the value of n will increase it will give tle