$ 0 0 Hello, I kept on getting NZEC on PRIMEDST with my solnI figured out that it was StackOverflowError, can someone please help and suggest some way to implement the algorithm in space efficient manner.