Closed caroltang0331 closed 3 years ago
so i guess maybe a 2D array works too?
Yes. As long as not using map
, feel free to use any data structures.
Even using a designed string encoding schema could lead to an alternative way of storing <key, freq>.
Is there a recommend data structure to keep track of the picked candidate and the frequency they are pick?
This is directly related to the final solution. So I would not give explicit hint.
one of the notes says we cannot use Map to store candidate. Is there a recommend data structure to keep track of the picked candidate and the frequency they are pick? I originally stored the picked candidate and frequency in a map and sort it based on the frequency, so i guess maybe a 2D array works too? but im just a little confused, can i get a hint on how to keep track of the frequency