Object-Oriented Programming · Square · Medium
A point-of-sale platform records its sales figures in a matrix whose rows are merchants and whose columns are product categories. Most merchant/category combinations have no sales at all, so the matrix is sparse. Design and implement a class that stores this sparse sales matrix and supports the following operations: Read the value stored at a given merchant and product category (get). Write a value at a given merchant and product category (set). Compute the total of a single…