Comment body goes here.

- there are two variables a, b which are used through out the program to process the value, hence space complexity is O(1);
- Time complexity : there are two loops of M iterations and N iterations . Hence time complexity will be O(M+N); time taken by initialization statements are ignored while calculating O() function.