Help with an interesting problem? Looks straightforward but I failed to do it today during online assessment.

Правка en1, от Vik, 2021-02-13 20:13:08

Constraints:

Size of the array: [1 10^5]

Element: 1 <= a[i] <= 10^6

Brute force won't work because of the constraints. I tried thinking of various ways but all were convoluted. I feel there is an easier way to think about it but I am missing some observation.

Any help would be highly appreciated.

Thanks!

Теги #arrays, #constructive algorithms

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Vik 2021-02-13 20:14:30 81
en1 Английский Vik 2021-02-13 20:13:08 431 Initial revision (published)