As a continuation of my dive into algorithms I was fortunate enough to work on an easy LeetCode question with a partner. The prompt is as follows:

Before I do any coding I try my best to analyze what the question is asking and what kind of output that is expected. The examples provided by LeetCode are extremely helpful.

The first steps I took was to set up my function and console logging helps with knowing what data you are working with. These are the next steps I took to solve this problem:

This was a fun problem to work through and it definitely set the tone for me learning how to think in terms of problem solving. Algorithms can sometimes be fun!

I’ll be adding another problem this upcoming week!

Full-Time Software Engineering Student at Flatiron School, avid golfer, and wannabe chef.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store