Basic implementation. We need to somehow keep the corresponding number of shelf of every name so that we can access it with the given names, the C++ map can help a lot here. Also one thing, for making a little easier you can easily notice that there are no 2 names that start with the same letter but belong to different shelfs which means that we can only consider the first letter of the names.
No comments:
Post a Comment