We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I think the goal was to teach us about sparse arrays but without sufficient memory or speed constraints we can freely decide to go with either a hash/dictionary or a sparse array.
For me the quickest solution with c++ was obviously using std::map. I'll try to implement it in sparse arrays and see what the differences are time and memory wise.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Sparse Arrays
You are viewing a single comment's thread. Return to all comments →
I think the goal was to teach us about sparse arrays but without sufficient memory or speed constraints we can freely decide to go with either a hash/dictionary or a sparse array.
For me the quickest solution with c++ was obviously using std::map. I'll try to implement it in sparse arrays and see what the differences are time and memory wise.