• + 0 comments

    Simple solution:

    #!/bin/bash
    
    read N
    read -a arr
    
    
    declare -A countElements
    
    for item in "${arr[@]}"; do
      ((countElements["$item"]++))
    done
    
    
    for key in "${!countElements[@]}"; do
      if ((countElements["$key"] == 1)); then
        echo "$key"
      fi
    done