Argon_36's blog

By Argon_36, history, 5 hours ago, In English

The question states the MINIMUM distance to be travelled to get to an island is a[i] not EXACT. But the solution/tutotial use EXACT distance.

I think this question deserves a review

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

»
97 minutes ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Minimum distance to be travelled to get to an island j from your current location i = min(|i — j| + 1) for all possible j values. After modelling it this way, I understood, especially the second testcase.