_Shiva_99's blog

By _Shiva_99, history, 6 years ago, In English

why this line --> [ while (hash < 0)hash += M;] is used in the solution of this problem

can anyone please help me??

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
6 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

I think it is just to make the value of hash between 0 and M-1 as it was earlier subtracted by something and could've gone negative