These are my answers to inteviewbit questions. There are no seperate test cases written for this problem.
Link for Problems: https://www.interviewbit.com/courses/programming/
Here i added some problems which are not part of interviewbit website. I added those problems because, it helps in better understanding of some of the problems. So please go through those questions also