Programming Interview Question — Longest String Chain

Question setup

Example

Input: ["ba","a","b","bca","bda","bdca"]
Output: 4
Explanation: one of the longest word chain is "a","ba","bda","bdca".

Visualizing with the Example

Data structure and Algorithm

--

--

--

Writing to soothe the soul, programming to achieve flow

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

Recommended from Medium

How to think recursively in programming.

To set Terminal shortcut in CentOS 8

Amazon Simple Queue Service(SQS)

Fix broken elasticsearch cluster

Essential Python Libraries for Data Analysis-1: Numpy

John Doe, The Super Developer — A object-oriented short story of a developer

Building a ToDo API with Golang and Kubernetes! — Part 1 — Introduction

Abbreviation of Computer — Computer Full Forms

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
Mipsmonsta

Mipsmonsta

Writing to soothe the soul, programming to achieve flow

More from Medium

Leetcode — Range Frequency Queries

How to tell if a Java hash map has a specific key in it with the containsKey() method

Leetcode Patterns Adventures 1 — Contains Duplicate