Answer:
//get size of array one
int size1 =2500; // sll $a2,$a2,2
int array1[size1];
//get size of array two
int size2 = 2500; // sll $a3,$a3,2
int array2[size2];
int v0=0 ; // $v0,$zero,$zero
int t0 = 0; //$t0,$zero,$zero
do{ //outer:
//add $t4,$a0,$t0
//lw $t4,0($t4)
int t4 = array1[t0];
int t1 = 0; //$t1,$zer0,$zer0
do{
//add $t3,$a1,$t1
//lw $t3,0($t3)
int t3 = array2[t1];
if(t3==t4){ //bne $t3,$t4,skip
v0 = v0+1; //addi $v0,$v0,1
}
//skip:
t1 = t1+1; //addi $t1,$t1,4
}while(t1!=size2);
t0 = t0+1; //addi $to,$to,4
}while(t0!=size1);
return 0;
Given code loops through the two array. It will count the number of duplicates found in both array.