HackWithInfy 2022

Правка en1, от prithwiraj15, 2022-03-15 21:22:46

This question appeared on HackWithInfy-2022

Problem Statement

You are given an array of length N containing a permutation of first N natual numbers i.e (1 to N). You are able to apply the following operation at most once. - Choose any subarray of size K and reverse it.

Return the minimum inversions in the array after said operations.

Inversion in an array is defined as a pair of indices (i,j) such that Ai > Aj and i < j.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский prithwiraj15 2022-03-15 21:41:46 796 Tiny change: 'st once.\n- Choose' -> 'st once.\n\n- Choose' (published)
en1 Английский prithwiraj15 2022-03-15 21:22:46 461 Initial revision (saved to drafts)