Thanks for your reply.
I got AC after switch nums to Map.
Should I always use Map to simulate random access to an Array?