You are viewing a single comment's thread. Return to all comments →
My Java Solution. Improvements welcome!
import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] input = new int[n]; for(int i = 0; i < n; i++) input[i] = sc.nextInt(); for(int i = 0; i < n; i++) System.out.println(input[input[i]-1]); } }
Security Permutations
You are viewing a single comment's thread. Return to all comments →
My Java Solution. Improvements welcome!