final code by abhijeet

final code with running test cases