Practice Design Spreadsheet
Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.
Problem Statement
Implement Spreadsheet(rows) with columns A through Z and rows numbered from 1; all cells start at zero and store integers from 0 through 10^5. setCell(cell, value) updates a reference such as A1 or B10, and resetCell(cell) sets it back to zero. getValue(formula) evaluates a string of the form =X+Y, where each operand is a cell reference or a nonnegative integer, and returns the sum. An unset cell contributes zero.
Source: Design Spreadsheet on LeetCode. Use the original task for its coding environment and submissions.
Examples
# Example 1
["Spreadsheet", "getValue", "setCell", "getValue", "setCell", "getValue", "resetCell", "getValue"] [[3], ["=5+7"], ["A1", 10], ["=A1+6"], ["B2", 15], ["=A1+B2"], ["A1"], ["=A1+B2"]]
[null, 12, null, 16, null, 25, null, 15]
Constraints
Related LeetCode Problems
Practice more problems similar to Design Spreadsheet.
Review your practice with PhantomCodeAI
After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.