We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 015ee2f commit 2bb4e9bCopy full SHA for 2bb4e9b
lib/src/easy/14.longest_common_prefix/main.dart
@@ -8,7 +8,7 @@
8
9
class Solution {
10
String longestCommonPrefix(List<String> strs) {
11
- if (strs.isEmpty) return '';
+ if (strs.join('').isEmpty) return '';
12
String prefix = strs[0];
13
for (int i = 1; i < strs.length; i++) {
14
while (strs[i].indexOf(prefix) != 0) {
0 commit comments