You are viewing a single comment's thread. Return to all comments →
Here is my Java code, works for all test cases
import java.util.*; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); Map XY = new HashMap<Integer, Integer>(); for(int i = 1; i <= n; i++) { XY.put(input.nextInt(), i); //Stores (x, y) as (y, x) } for(int i = 1; i <= XY.size(); i++) { System.out.println(XY.get(i)); } } }
Seems like cookies are disabled on this browser, please enable them to open this website
Security Function Inverses
You are viewing a single comment's thread. Return to all comments →
Here is my Java code, works for all test cases