package com.company;
import java.util.*;
class Solution {
static public void main(String[] args){
String[] participant = {"mislav", "stanko", "mislav", "ana"};
String[] completion = {"stanko", "ana", "mislav"};
System.out.println(solution(participant, completion));
}
static public String solution(String[] participant, String[] completion) {
Map<String, Integer> diffMap = new HashMap<>();
for (String parti : participant) {
diffMap.put(parti, diffMap.getOrDefault(parti, 0) + 1);
}
for (String comple : completion) {
diffMap.put(comple, diffMap.get(comple) - 1);
}
for(String parti : participant) {
if(diffMap.get(parti) > 0 ){
return parti;
}
}
return null ;
}
}