I had an interview question asking this:
text file has following lines>
1: A C D 4: A B 5: D F 7: A E 9: B C
*Every line has a unique integer followed by a colon and one or more letters. These letters are delimited spaces (one or more)>
#2 Write a short program in the language
of your choice that outputs a sorted list like
A: 1 4 7 B: 4 9 C: 1 9 D: 1 5 E: 7 F: 5
I'm not looking for someone to solve it, but I always get confused with problems like this. I'd like to do it in C# and was wondering should I store each line in a 2d array? What is the best way to handle this. After storing it how do I relist each line with letters rather then numbers?
Just looking for pointers here.