~5min
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```typescript []
class Calculator {
    result = 0
    constructor(value: number) {
        this.result = value
    }
    
    add(value: number): Calculator {
        this.result += value
        return this
    }
    
    subtract(value: number): Calculator {
        this.result -= value
        return this
    }
    
    multiply(value: number): Calculator {
        this.result *= value
        return this
    }
    
    divide(value: number): Calculator {
        if (!value) {
            throw "Division by zero is not allowed"
        }
        this.result /= value
        return this
    }
    
    power(value: number): Calculator {
        this.result **= value
        return this
    }
    
    getResult(): number {
        return this.result
    }
}
```
['TypeScript']