I have developed the following pseudocode for the sum of pairs problem:Given an array $A$ of integers and an integer $b$, return YES if there are positions $i,j$ in $A$ with $A[i] + A[j] = b$, NO otherwise.Now I should state a loop invariant that shows that my algorithm is correct. Can someone give me a hint of a valid loop invariant? PAIRSUM(A,b):YES := true;NO := false;n := length(A);if n<2 then  return NO;SORT(A);i := 1;j := n;while i < j do  // Here I should state my invariant   currentSum := A[i] + A[j];   if currentSum = b  then      return YES;   else     if currentSum < b then      i := i + 1;    else      j := j  1;return NO;
Loop invariant for an algorithm
algorithms;proof techniques;loop invariants