{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "
Write a function to find the longest common prefix string amongst an array of strings.
\n", "\n", "If there is no common prefix, return an empty string \"\".
\n", "
Example 1:
\n", "\n", "Input: strs = [\"flower\",\"flow\",\"flight\"]\n",
"Output: \"fl\"\n",
"\n",
"\n",
"Example 2:
\n", "\n", "Input: strs = [\"dog\",\"racecar\",\"car\"]\n",
"Output: \"\"\n",
"Explanation: There is no common prefix among the input strings.\n",
"\n",
"\n",
"\n", "
Constraints:
\n", "\n", "0 <= strs.length <= 2000 <= strs[i].length <= 200strs[i] consists of only lower-case English letters.\n", "Source \n", "
Could you solve it using the following implementation:
\n", "