TDD Tuesday Kickoff: Solving Leetcode’s Hard Basic Calculator
How to Solve Leetcode’s Basic Calculator Problem with Python
I believe in staying technical.
Like any skill, if you don’t practice it, you lose it. And this applies to both individual contributors and managers. Sometimes, staying technical means sharpening your existing tools. Other times, it means picking up entirely new tools — or even an entirely new toolbox.
With that in mind, I’m kicking off a new series called Technical Deep Dive (TDD) Tuesday where I’ll explore various technical topics. The first sub-series will focus on a specific Leetcode problem: Basic Calculator (Hard level).
I’ve implemented two solutions that were accepted on Leetcode: one using a modified version of Dijkstra’s two-stack algorithm and the other using syntax-directed interpretation (who knew some compiler and interpreter knowledge could come in handy? :)
In this Basic Calculator sub-series, I’ll walk you through these solutions. My hope is that you’ll enjoy the ride — and who knows, you might even find it useful if you’re prepping for interviews or practicing on Leetcode.
Just a heads-up: I’m not claiming my solutions are the most optimal. Consider this an exploration. I’ll be using Python 3, and each post will include exercises to help you dig a little deeper if you’re up for the challenge.
Stay curious, and I look forward to diving into this with you in the next post of the TDD Tuesday series.
Ruslan