Update get_num_parts.cs

building the cache as a matrix instead of Hashtable.