Longest Common Prefix — JavaScript easy interview problem
Write a function to find the longest common prefix string amongst an array of strings. If there is no common prefix, return an empty string `""`. Example: `longestCommonPrefix(["flower","flow","flight"])` → `"fl"`.
Tags: prefix, vertical-scan
Practice this Strings problem free in the JS Interview Playground with automated tests and unlockable solutions.