codeparrot/codecomplex huggingface dataset:
// Problem: 1000_A. Codehorses T-shirts
// Time complexity: linear
//package jsr.codeforces;

import java.util.HashMap;
import java.util.Scanner;

public class AMatchLists {


    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        HashMap<String, Integer> map = new HashMap<>();
        for(int i=0; i<N; i++){
            String str = in.next();
            if(map.get(str)==null){
                map.put(str, 0);
            }
            map.put(str, map.get(str)+1);
        }

        HashMap<String, Integer> map2 = new HashMap<>();
        for(int i=0; i<N; i++){
            String str = in.next();
            if(map.get(str)!=null){
                if(map.get(str)==1)
                    map.remove(str);
                else
                    map.put(str, map.get(str)-1);
            }
            else{
                if(map2.get(str)==null){
                    map2.put(str, 0);
                }
                map2.put(str, map2.get(str)+1);
            }
        }
        int[] count= {0};

        map2.forEach((key, value)->{
                count[0] += value;
                });

        System.out.println(count[0]);

        //M, XS, XXS, XXXS, L, XL, XXl, XXXL
    }

}
// Problem: 1000_A. Codehorses T-shirts
// Time complexity: linear
import java.util.*;
import static java.lang.Math.*; 
import static java.util.Arrays.*;
import static java.lang.Character.*;
import static java.lang.Double.*;


public class A {

	Scanner scan = new Scanner(System.in);
	
	
	void solve() {
		int n = scan.nextInt();
		String[]A = new String[n];
		String[]B = new String[n];
		int res =0;
		for(int i=0;i<n;i++)A[i]=scan.next();
		for(int i=0;i<n;i++)B[i]=scan.next();
		for(int i=0;i<A.length;i++) {
			boolean fnd = false;
			for(int j=0;j<B.length;j++) {
				if(A[i].equals(B[j])) {
					fnd = true;
					B[j]="";
					break;
				}
			}
			if(!fnd)res++;
		}
		System.out.println(res);
	}
	
	public static void main(String[] args) {
		new A().solve();
	}
}
// Problem: 1000_A. Codehorses T-shirts
// Time complexity: linear
// //package ;
import java.io.*;
import java.util.*;

public class A
{
	public static int sol(String n,String p)
	{
		int sol=0;
		for(int i=0;i<n.length();i++)
		{
			if(n.charAt(i)!=p.charAt(i))
				sol++;
		}
		return sol;
	}
	public static void main(String[] args) throws IOException 
	{
		Scanner sc = new Scanner();
		PrintWriter pw = new PrintWriter(System.out);
		int n=sc.nextInt();
		ArrayList<String>p=new ArrayList<>();
		ArrayList<String>ne=new ArrayList<>();
		for(int i=0;i<n;i++)
			p.add(sc.nextLine());
		for(int i=0;i<n;i++)
		{	
			String t=sc.nextLine();
			if(p.contains(t))
				p.remove(t);
			else
				ne.add(t);
		}
		Collections.sort(p);
		Collections.sort(ne);
		int ans=0;
		for(int i=0;i<ne.size();i++)
		{
			ans+=sol(ne.get(i),p.get(i));
		}
		System.out.println(ans);
		pw.close();    
	}
	static class Scanner {
		BufferedReader br;
		StringTokenizer st;
		
		Scanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		
		String next() throws IOException {
			while (st == null || !st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
			}
			return st.nextToken();
		}
		
		int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
		
		long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		
		double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
		
		String nextLine() throws IOException {
			return br.readLine();
		}
		boolean hasnext() throws IOException{
			return br.ready();
		}
		
	}
}
// Problem: 1000_A. Codehorses T-shirts
// Time complexity: linear
import java.util.*;
import java.io.*;

public class cfedu46a{
	public static void main(String [] args) throws IOException{
		InputReader in = new InputReader("cfedu46a.in");
		
		int [] arr = new int[9];
		int [] arr2 = new int[9];
		int [] size = {4, 3, 2, 1, 1, 1, 2, 3, 4};
		int n = in.nextInt();
		for(int i = 0; i < n; i++){
			String s = in.next();
			switch(s.length()){
				case 1: 
					if(s.charAt(0) == 'S')
						arr[3]++;
					if(s.charAt(0) == 'M')
						arr[4]++;
					if(s.charAt(0) == 'L')
						arr[5]++;
					break;
				default:
					if(s.charAt(s.length() - 1) == 'S'){
						arr[3 - (s.length() - 1)]++;
					}
					if(s.charAt(s.length() - 1) == 'L'){
						arr[5 + (s.length() - 1)]++;
					}

			}
		}
		for(int i = 0; i < n; i++){
			String s = in.next();
			switch(s.length()){
				case 1: 
					if(s.charAt(0) == 'S')
						arr2[3]++;
					if(s.charAt(0) == 'M')
						arr2[4]++;
					if(s.charAt(0) == 'L')
						arr2[5]++;
					break;
				default:
					if(s.charAt(s.length() - 1) == 'S'){
						arr2[3 - (s.length() - 1)]++;
					}
					if(s.charAt(s.length() - 1) == 'L'){
						arr2[5 + (s.length() - 1)]++;
					}

			}
		}
		int cnt = 0;
		for(int i = 0; i < 9; i++){
			if(arr[i] == arr2[i])
				continue;
			else{
				cnt += (arr2[i] - arr[i] > 0? arr2[i] - arr[i]: 0);
			}
		}
		System.out.println(cnt);
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(String s) {
			try{
				reader = new BufferedReader(new FileReader(s), 32768);
			}
			catch (Exception e){		
				reader = new BufferedReader(new InputStreamReader(System.in), 32768);
			}
			tokenizer = null;
		}
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
				    tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
				    throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}
	}
}
// Problem: 1000_A. Codehorses T-shirts
// Time complexity: linear
import java.util.*;
import java.io.*;
public class CodehorsesTshirts {
    
    
    
    /************************ SOLUTION STARTS HERE ************************/
    
    
    private static void solve() {
        
        
        int n = nextInt();
        
        HashMap<String, Integer> a = new HashMap<>();
        HashMap<String, Integer> b = new HashMap<>();
        
        for(int i = 0; i < n; i++)
            a.merge(nextLine(), 1, Integer::sum);
        
        for(int i = 0; i < n; i++)
            b.merge(nextLine(), 1, Integer::sum);
        
        b.forEach((k , v) -> {
            if(a.containsKey(k))
                a.put(k, a.get(k) - Math.min(v , a.get(k)));
        });
        
        int cost = a.values().stream().reduce(0, Integer::sum);
        
        println(cost);  
        
    }
    
    
    
    /************************ SOLUTION ENDS HERE ************************/
    
    
    
    
    
    /************************ TEMPLATE STARTS HERE **********************/
    
    public static void main(String[] args) throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false);
        st     = null;
        solve();
        reader.close();
        writer.close();
    }
    
    static BufferedReader reader;
    static PrintWriter    writer;
    static StringTokenizer st;
    
    static String next()
    {while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}            
    st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
    static String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}             
    static int    nextInt()   {return Integer.parseInt(next());}
    static long   nextLong()  {return Long.parseLong(next());}     
    static double nextDouble(){return Double.parseDouble(next());}
    static char   nextChar()  {return next().charAt(0);}
    static int[]  nextIntArray(int n)         {int[] a= new int[n];   int i=0;while(i<n){a[i++]=nextInt();}  return a;}
    static long[] nextLongArray(int n)        {long[]a= new long[n];  int i=0;while(i<n){a[i++]=nextLong();} return a;}    
    static int[]  nextIntArrayOneBased(int n) {int[] a= new int[n+1]; int i=1;while(i<=n){a[i++]=nextInt();} return a;}            
    static long[] nextLongArrayOneBased(int n){long[]a= new long[n+1];int i=1;while(i<=n){a[i++]=nextLong();}return a;}            
    static void   print(Object o)  { writer.print(o);  }
    static void   println(Object o){ writer.println(o);}
    
    /************************ TEMPLATE ENDS HERE ************************/
    
}
// Problem: 1000_A. Codehorses T-shirts
// Time complexity: linear
import java.util.*;
import java.io.*;
public final class CF {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        ArrayList<String> a = new ArrayList<>();
        for(int i = 0; i<n; i++)
            a.add(sc.next());
        int count = 0;
        for(int i = 0; i<n; i++) {
            String b = sc.next();
            int idx = a.indexOf(b);
            if(idx!=-1)
                a.remove(idx);
            else
                count++;
        }
        System.out.println(count);
    }
}
// Problem: 1000_A. Codehorses T-shirts
// Time complexity: linear
import java.util.*;
public class algo121
{
    public static void main(String args[])
    {
        Scanner ex=new Scanner(System.in);
        int n=ex.nextInt();
        String a[]=new String[n];
        String b[]=new String[n];
        for(int i=0;i<n;i++)
        a[i]=ex.next();
        for(int i=0;i<n;i++)
        b[i]=ex.next();
        String valid[]={"S","M","L","XS","XL","XXS","XXL","XXXS","XXXL"};
        int ai[]=new int[9];
        int bi[]=new int[9];
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<9;j++)
            {
                if(a[i].equals(valid[j]))
                ai[j]++;
                if(b[i].equals(valid[j]))
                bi[j]++;
            }
        }
        int ans=0;
        for(int i=0;i<9;i++)
        {
            if(ai[i]>bi[i])
            ans=ans+ai[i]-bi[i];
        }
        System.out.println(ans);
    }
}
// Problem: 1000_A. Codehorses T-shirts
// Time complexity: linear
import java.io.*;
import java.util.*;

public class A
{	
	
	
		public static void main(String[] args) throws IOException 
		{
				
				Scanner sc=new Scanner(System.in);
				PrintWriter pw=new PrintWriter(System.out);
				int n=sc.nextInt();
				String []a=new String[n];
				String []b=new String[n];
				
				TreeMap<String,Integer> map1=new TreeMap(),map2=new TreeMap();
				for(int i=0;i<n;i++)
				{
					String s=sc.next();
					map1.put(s, map1.getOrDefault(s, 0)+1);
					
				}
				for(int i=0;i<n;i++)
				{
					String s=sc.next();
					map2.put(s, map2.getOrDefault(s, 0)+1);
					
				}
				int ans=0;
				for(String s:map2.keySet())
				{
					int cnt=map1.getOrDefault(s, 0);
					ans+=Math.max(0, map2.get(s)-cnt);
				}
				pw.println(ans);
				pw.close();
		}
		
		
		
		static class Scanner
		{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public Scanner(String s) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(s));
		}
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

		
		
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.util.*;
import java.io.*;

public class Solution {
    public static void main(String str[]) throws Exception{
        Scanner sc = new Scanner(System.in);
        BufferedWriter output = new BufferedWriter(
                new OutputStreamWriter(System.out));
        int t = sc.nextInt();
        while(t-->0){
            int n = sc.nextInt();
            if((n%2==0 && Math.pow(n/2,0.5)%1.0==0) || (n%4==0 && Math.pow(n/4,0.5)%1.0==0) )  output.write("YES\n");
            else {
                output.write("NO\n");
            }
        }
        output.flush();
    }

}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.util.*;
 public  class  AA{
		public static void main(String[] args) {
			Scanner sc=new Scanner(System.in);
		    int t=0;
		    if(sc.hasNextInt()) {
		    	t=sc.nextInt();
		    }
		    while(t>0) {
		    	t--;
				 int n=sc.nextInt();
				 String ans="NO";
				 if(n%2==0) {
					 int p=n/2;
					 if(Math.ceil(Math.sqrt((double)p)) == Math.floor(Math.sqrt((double)p))){
						 ans="YES";
					 }
					 else {
						 if(n%4==0) {
							 p=n/4;
							 if(Math.ceil(Math.sqrt((double)p)) == Math.floor(Math.sqrt((double)p))){
								 ans="YES";
							 }
						 }
					 }
				 }
				 System.out.println(ans);
		    }
		}
  }
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
//package Round14Global;

import java.util.*;
import java.io.*;

public class phoenixandpuzzle {
	public static void main(String[] args) throws IOException {
		BufferedReader fin = new BufferedReader(new InputStreamReader(System.in));
		int t = Integer.parseInt(fin.readLine());
		StringBuilder fout = new StringBuilder();
		HashSet<Integer> dict = new HashSet<Integer>();
		int pointer = 1;
		int area = 0;
		while(area >= 0) {
			area = (pointer * pointer) * 2;
			dict.add(area);
			pointer ++;
		}
		pointer = 1;
		area = 0;
		while(area >= 0) {
			area = (pointer * pointer) * 4;
			dict.add(area);
			pointer ++;
		}
		while(t-- > 0) {
			int n = Integer.parseInt(fin.readLine());
			if(dict.contains(n)) {
				fout.append("YES\n");
			}
			else {
				fout.append("NO\n");
			}
		}
		System.out.print(fout);
	}
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.PrintWriter;
import java.util.Scanner;

public class Main {

    static Scanner sc;
    static PrintWriter out;

    public static void main(String[] args) {
        sc = new Scanner(System.in);
        out = new PrintWriter(System.out);
        int t = 1;
        if (true) {
            t = sc.nextInt();
        }
        for(int i=0; i<t; i++) {
            new Main().solve();
        }
        out.flush();
    }

    public void solve() {
        long n = sc.nextInt();
        if(n % 2 == 1) {
            out.println("NO");
            return;
        }
        for(long i=1; i*i*2 <= n; i++) {
            if(i * i * 2 == n || i * i * 4 == n) {
                out.println("YES");
                return;
            }
        }
        out.println("NO");

    }

}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
///package round_global_14;


import java.io.*;
import java.util.*;

public class B {
    static class InputReader {
        BufferedReader buffreader;
        StringTokenizer strtokenizer;
        public InputReader(InputStream inputstr) {
            buffreader = new BufferedReader(new InputStreamReader(inputstr), 1000000);strtokenizer = null; }
        //////////////////////////////////////////////////////////////////////////////////////////
        String next() {
            while (strtokenizer == null || !strtokenizer.hasMoreTokens()) {
                try { strtokenizer = new StringTokenizer(buffreader.readLine()); }
                catch (IOException e) { throw new RuntimeException(e); }
            }
            return strtokenizer.nextToken(); }
        ///////////////////////////////////////////////////////////////////////////////////////////
        public int nextInt() { return Integer.parseInt(next()); }
        public long nextLong() { return Long.parseLong(next()); }
        public double nextDouble() { return Double.parseDouble(next()); }
        public int[] nextIntArr(int n){
            int[] arr=new int[n];
            for (int i=0;i<n;i++){arr[i]=nextInt();}
            return arr;}
        public long[] nextLongArr(int n){
            long[] arr=new long[n];
            for (int i=0;i<n;i++){arr[i]=nextLong();}
            return arr;}
        public String[] nextStringArr(int n){
            String[] arr=new String[n];
            for (int i=0;i<n;i++){arr[i]=next();}
            return arr;}
    }
    static InputReader r = new InputReader(System.in);
    static PrintWriter pw = new PrintWriter(System.out);
    public static void main(String[] args){
        int t=r.nextInt();
        for (int v=0;v<t;v++){
            int n=r.nextInt();
            if (n%2==1){
                pw.println("NO");
            }
            else{
                int x=n/2;
                boolean check=false;
                for (int i=1;i<=(int)Math.sqrt(x)+1;i++){
                    if (i*i*2==x||i*i==x){
                        pw.println("YES");check=true;break;
                    }
                }
                if (!check){
                    pw.println("NO");
                }
            }


        }
        pw.close();


    }
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;



public class B {
	int mod=1000_000_007;
	public static void main(String[] args) throws Exception {
		
		PrintWriter out=new PrintWriter(System.out);
	    FastScanner fs=new FastScanner();
	    int t=fs.nextInt();
	    while(t-->0) {
	    	double n=fs.nextInt();
	    	if(isp(n/2)||isp(n/4)) {
	    		System.out.println("YES");
	    	}
	    	else System.out.println("NO");
	    }
	}
	static boolean isp(double n) {
		if(n==0) return false;
		double a=Math.ceil(Math.sqrt(n));
		double b=Math.floor(Math.sqrt(n));
		return a==b;
	}
	static void mysort(long[] a) {
		//suffle
		int n=a.length;
		Random r=new Random();
		for (int i=0; i<a.length; i++) {
			int oi=r.nextInt(n);
			long temp=a[i];
			a[i]=a[oi];
			a[oi]=temp;
		}
		
		//then sort
		Arrays.sort(a);
	}
	
	// Use this to input code since it is faster than a Scanner
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}
 
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.Math.round;
import static java.lang.Math.sqrt;
import static java.lang.System.exit;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class B {

	static long sqr(long a) {
		return a * a;
	}

	static void solve() throws Exception {
		int tests = scanInt();
		for (int test = 0; test < tests; test++) {
			int n = scanInt();
			out.println(n == 2 * sqr(round(sqrt(n / 2))) || n == 4 * sqr(round(sqrt(n / 4))) ? "YES" : "NO");
		}
	}

	static int scanInt() throws IOException {
		return parseInt(scanString());
	}

	static long scanLong() throws IOException {
		return parseLong(scanString());
	}

	static String scanString() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	public static void main(String[] args) {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();
			in.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			exit(1);
		}
	}
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;

public class p2 {
	final static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	private static String ss() throws IOException {return br.readLine();}	
	private static int stoi(String x) {return Integer.parseInt(x);}
	private static int si() throws IOException {return stoi(ss());}
	private static long sl() throws IOException {return Long.parseLong(ss());}	
	private static int[] sia(int len) throws IOException {
		int[] ret = new int[len];
		final StringTokenizer st = new StringTokenizer(ss());
		for (int i = 0; i < len; ++i) {ret[i] = stoi(st.nextToken());}
		return ret;
	}
	private static long[] sla(int len) throws IOException {
		long[] ret = new long[len];
		final StringTokenizer st = new StringTokenizer(ss());
		for (int i = 0; i < len; ++i) {ret[i] = Long.parseLong(st.nextToken());}
		return ret;
	}
	
	public static void main (final String[] args) throws IOException {
		//goal is to always be higher
		Set<Integer> poss = new HashSet<>();
		for (int i = 1; 2 * (i*i) <= 1000000000; ++i) {
			poss.add(2 * (i*i));
			poss.add(4 * (i*i));
		}
		int t = si();
		for (int i = 0; i < t; ++i) {
			int n = si();
			if (poss.contains(n)) System.out.println("YES");
			else System.out.println("NO");
		}
	}
}
// Problem: 1515_B. Phoenix and Puzzle
// Time complexity: linear
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;

public class B {

	public static void main(String[] args) {
		FastScanner fs=new FastScanner();
		int T=fs.nextInt();
		for (int tt=0; tt<T; tt++) {
			int n=fs.nextInt();
			boolean isEven=n%2==0;
			while (n%2==0) n/=2;
			if (isSquare(n) && isEven) {
				System.out.println("YES");
			}
			else {
				System.out.println("NO");
			}
		}
	}
	
	static boolean isSquare(long n) {
		long sqrt=(long) Math.sqrt(n);
		for (int i=(int) Math.max(1, sqrt-5); i<=sqrt+5; i++)
			if (i*i==n)
				return true;
		return false;
	}

	static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}
	
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}

	
}