Solution to LOOP_CMPL


Comment body goes here.

  1. there are two variables a, b which are used through out the program to process the value, hence space complexity is O(1);
  2. 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.