One line difference between correct and wrong solution


#1

Can someone tell what is the difference between the two scenarios:

  1. y = ( (A%C) * Mod( A , B-1 , C ) )%C;
  2. y = A % C
    y = ( y * Mod( A , B-1 , C)) % C

My solution changes from wrong to correct by changing 1 to 2.