From c5356e81ce5854f0d46f115e8be95f0bc9c90424 Mon Sep 17 00:00:00 2001 From: Laitooo Date: Sun, 8 Jan 2023 04:48:11 +0200 Subject: [PATCH] Create 0014-Longest-Common-Prefix.dart --- dart/0014-longest-common-prefix.dart | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 dart/0014-longest-common-prefix.dart diff --git a/dart/0014-longest-common-prefix.dart b/dart/0014-longest-common-prefix.dart new file mode 100644 index 000000000..cb67a5e19 --- /dev/null +++ b/dart/0014-longest-common-prefix.dart @@ -0,0 +1,14 @@ +class Solution { + String longestCommonPrefix(List strs) { + String res = ""; + for (int i=0; i= s.length || strs[0][i] != s[i]){ + return res; + } + } + res += strs[0][i]; + } + return res; + } +} \ No newline at end of file