Python Check Array Contains Value Hashmap