Function to return the chosen indices
function solve ( X , A ) { let min = Number . MAX_VALUE ; let ind = - 1 ; for ( let i = 0 ; i < A . length ; i ++ ) { if ( A [ i ] < min ) { min = A [ i ] ; ind = i ; } }