Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Put all the possible prefixes of each element in <code>arr1</code> into a HashSet.
For all the possible prefixes of each element in <code>arr2</code>, check if it exists in the HashSet.