Function to check if we have seen a value before and update the seenMap
Map of seen values
key to check
value to check
Function to check if we have seen a value before and update the seenMap