You are viewing a single comment's thread. Return to all comments →
c# code for read input -> string[] ar_temp = Console.ReadLine().Split(' '); int[] ar = Array.ConvertAll(ar_temp,Int32.Parse);
Java code for read input - > for(int ar_i = 0; ar_i < n; ar_i++){ ar[ar_i] = in.nextInt(); }
You may have got the logic now, why he mentioned "Add directly to Set from read" - merge two forloops into one, this will give better performance.
Seems like cookies are disabled on this browser, please enable them to open this website
Sales by Match
You are viewing a single comment's thread. Return to all comments →
c# code for read input -> string[] ar_temp = Console.ReadLine().Split(' '); int[] ar = Array.ConvertAll(ar_temp,Int32.Parse);
Java code for read input - > for(int ar_i = 0; ar_i < n; ar_i++){ ar[ar_i] = in.nextInt(); }
You may have got the logic now, why he mentioned "Add directly to Set from read" - merge two forloops into one, this will give better performance.