Longest Common Prefix

Everything old is new again.
// find the shortest string in my array(SMALLEST), since the common prefix can't be bigger than that.
// loop through the SMALLEST word in the array
// compare that to the nth letter in each word as we loop through the entire array
// if it matches, add it to our "answer string"
// if not, pull the brakes and return what we have
// Rinse. Repeat.
CONCATENATION. (i think that’s a word)
our finished project.
not all heroes wear capes

--

--

--

Current Software Engineer student at Flatiron School, 11 year Math Teacher, 20 year thespian.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Insertion Sort (Javascript)

Disabling Vue.js Devtools in Production

‘Node Knoggin’ #303

4238% faster pages: how to cache Angular Universal routes

A Date-Fns Guide for your next React Project

Adding Film Grain To Images in React with react-postprocessing

Reduce the impact of third-party code on React

Psql — Postgresql cheat sheet

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
Ryan Bollettino

Ryan Bollettino

Current Software Engineer student at Flatiron School, 11 year Math Teacher, 20 year thespian.

More from Medium

What If I Could Turn Back Time?

movie: About Time / 2013

Clients are People

How to Spend Your Salary Smartly!

How I fought the coming lack of money and the baseness of the situation and continue to fight.