Abhibansal53's blog

By Abhibansal53, history, 9 years ago, In English

Given two arithmetic sequences (a1,d1 i.e. first term and common difference of first sequence and similarly a2,d2),what is the best algorithm to tell whether they have any common term,and if yes then tell the lowest one.

Full text and comments »

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

By Abhibansal53, history, 9 years ago, In English

Can anybody please explain me the following part of this Solution:- int t = H[h][l].second ^ H[h][r].second; bool ok = t — (t & -t); if(!ok) printf("Yes\n"); else printf("No\n");

Full text and comments »

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