mirror of
https://github.com/krahets/hello-algo.git
synced 2026-05-11 19:17:05 +08:00
Add Dart codes to the documents. (#529)
This commit is contained in:
@@ -24,6 +24,7 @@ int findOne(List<int> nums) {
|
||||
// 当元素 1 在数组尾部时,达到最差时间复杂度 O(n)
|
||||
if (nums[i] == 1) return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -36,5 +37,6 @@ int main() {
|
||||
print('\n数组 [ 1, 2, ..., n ] 被打乱后 = $nums');
|
||||
print('数字 1 的索引为 + $index');
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user