File tree 3 files changed +22
-0
lines changed
3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,4 @@ Profile on LeetCode: [fartem](https://leetcode.com/fartem/).
25
25
| 58. Length of Last Word | [ Link] ( https://leetcode.com/problems/length-of-last-word/ ) | [ Link] ( ./lib/easy/length_of_last_word.dart ) |
26
26
| 66. Plus One | [ Link] ( https://leetcode.com/problems/plus-one/ ) | [ Link] ( ./lib/easy/plus_one.dart ) |
27
27
| 67. Add Binary | [ Link] ( https://leetcode.com/problems/add-binary/ ) | [ Link] ( ./lib/easy/add_binary.dart ) |
28
+ | 69. Sqrt(x) | [ Link] ( https://leetcode.com/problems/sqrtx/ ) | [ Link] ( ./lib/easy/sqrt_x.dart ) |
Original file line number Diff line number Diff line change
1
+ import 'dart:math' ;
2
+
3
+ // https://leetcode.com/problems/sqrtx/
4
+ class Solution {
5
+ int mySqrt (int x) {
6
+ return sqrt (x).toInt ();
7
+ }
8
+ }
Original file line number Diff line number Diff line change
1
+ import 'package:leetcode_dart/easy/sqrt_x.dart' ;
2
+ import 'package:test/test.dart' ;
3
+
4
+ void main () {
5
+ group (
6
+ 'Example tests' ,
7
+ () {
8
+ final sx = Solution ();
9
+ test ('2' , () => expect (2 , sx.mySqrt (4 )));
10
+ test ('2' , () => expect (2 , sx.mySqrt (8 )));
11
+ },
12
+ );
13
+ }
You can’t perform that action at this time.
0 commit comments