LC: 631. Design Excel Sum Formula - spiralgo/algorithms GitHub Wiki
631. Design Excel Sum Formula:
The Essence:
When calculating the value of each cell, there are 2 possibilities:
- The cell only has a value.
- The cell points to a collection of cells and/or rectangles.
set() method updates the value of some cell to an integer.
sum() method updates the value of some cell to a collection of cell names.
In order to get the value of summed cells, 2. type of cells, we try to calculate the value of each cell/rectangle they point at.
Details:
For a detailed explanation and the implementation, please refer to the corresponding PR: