We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 06a92f5 + e63b453 commit 8fbf104Copy full SHA for 8fbf104
dart/0070-climbing-stairs.dart
@@ -0,0 +1,13 @@
1
+class Solution {
2
+ int climbStairs(int n) {
3
+ int first=0;
4
+ int second=1;
5
+ int res=1;
6
+ for(int i=0;i<n;i++){
7
+ res=first+second;
8
+ first=second;
9
+ second=res;
10
+ }
11
+ return res;
12
13
+}
dart/0136-single-number.dart
@@ -0,0 +1,19 @@
+ int singleNumber(List<int> nums) {
+ int? val = null;
+ nums.sort();
+ int i = 0;
+ while (i < nums.length - 2) {
+ if (!(nums[i] != nums[i + 2] && nums[i] == nums[i + 1])) {
+ val = nums[i];
+ break;
+ } else {
+ i = i + 2;
14
+ if (val == null) {
15
+ val = nums[nums.length - 1];
16
17
+ return val;
18
19
0 commit comments