Problem Description
You are provided with two arrays, arr1 and arr2, with sizes N and M respectively. Your task is to perform the following operations:
1. Intersection: Find all elements that appear in both arrays.
2. Union: Find all unique elements from both arrays, combining them while removing any duplicates.