The thing I'm not sure about is how efficient this is, having an array for each piece of information doesn't seem that memory efficient.
Is the idea I have a good solution, or is there a better way I haven't thought about?
Any advice would be great! Thanks
The review was presented as one that had been closed (though it actually hadn't been closed), and the audit expected me to reopen: "This was an audit, designed to see if you were paying attention. You didn't pass. There are no major problems with this question. You should click Reopen, or make minor corrections via Edit and Reopen."
Unless there's a single solution to this sort of thing, isn't this too broad? There are lots of possible answers, and which is best would depend on the usage patterns in the OP's application, and other factors. Since it's a question about efficiency, I don't think that it's primarily opinion based, since any solutions could, at least in principle, be compared.
Might this be more appropriate on, e.g., Code Review or Programmers?