Abhibansal53's blog

By Abhibansal53, history, 5 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.

Read more »

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

By Abhibansal53, history, 5 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");

Read more »

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