mahin661's blog

By mahin661, history, 12 days ago, In English

This is very intersting problem.I almost solved this problem correctly but i did a small mistake.Actually I solved this problem using prefix sum.First I calculated left sum then top to bottom sum.Then I print this , a[x2][y2]-a[x1-1][y2]-a[x2][y1-1].Sample test passed but wrong answer in hidden test cases. Then I thought more and got where I made mistake. Acctualy I forgot to add a[x-1][y-1].The acctual answer will be a[x2][y2]-a[x1-1][y2]-a[x2][y1-1]+a[x-1][y-1] For better understand, check this image first https://www.techiedelight.com/wp-content/uploads/Result.png Thank You

Full text and comments »

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

By mahin661, history, 4 weeks ago, In English

2 years of my coding journey and still thinking solving approach in noob way. Stuck in a very easy problem for 2 days, and not for single time I thought that if I count product of all elements then it will be overflowed! How noob I am!! spent more than 2 days on this easy problem!! What should I do now? Is it high time to give it up my coding journing? I am too tired.....

Full text and comments »

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