← 返回 amazon 的题目列表Odd Frequency Linked List
类型:online_judge
Given a linked list and a hash map containing characters, implement a function to verify if there is any character in the linked list with an odd frequency of occurrence, based on a predefined frequency context in the hash map. The linked list and hash map characters are lowercase letters. Return True if there is at least one character with an odd frequency; otherwise, return False. Assume there are no null elements in the linked list.
Input
Linked list head representing the values of each node as characters.
Hash map frequency, where the key is a lowercase letter and the value is its frequency of occurrence in other contexts.
Output
A boolean value indicating if there is an odd frequency character.
Example
Input: ["a", "b", "c", "a", "b", "d"]
Output: True
Explanation: Characters "c" and "d" appear once, which is an odd number of times.
Data size:
Link list length between [1, 10^5].
Hash map size is 26 (lowercase alphabet).
Example
Input
["a", "b", "c", "a", "b", "d"]