shivanshsingh9670's blog

By shivanshsingh9670, history, 22 months ago, In English

Problem : 1324-D Submission : My Solution

It is giving WA, but Test case is long and can't figure out the mistake.

  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
22 months ago, # |
Rev. 2   Vote: I like it +3 Vote: I do not like it

You're going wrong because you're taking the absolute value of the difference thereby you're missing out on the possibility sometimes even negative difference can be added to satiate the property, it works after you just simply negate the difference when you perform the lowerbound.

My Code — Python. 195945910

Your code changed. 195946124