Блог пользователя Argon_36

Автор Argon_36, история, 5 часов назад, По-английски

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

  • Проголосовать: нравится
  • -15
  • Проголосовать: не нравится

»
97 минут назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

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.