File tree Expand file tree Collapse file tree 2 files changed +16
-18
lines changed
main/java/com/fishercoder/solutions
test/java/com/fishercoder Expand file tree Collapse file tree 2 files changed +16
-18
lines changed Original file line number Diff line number Diff line change 11
11
12
12
public class _122 {
13
13
public static class Solution1 {
14
- //peak and valley appraoch
14
+ //peak and valley approach
15
15
public int maxProfit (int [] prices ) {
16
16
int pro = 0 ;
17
17
int i = 0 ;
@@ -42,5 +42,4 @@ public int maxProfit(int[] prices) {
42
42
return pro ;
43
43
}
44
44
}
45
-
46
45
}
Original file line number Diff line number Diff line change 7
7
import static junit .framework .Assert .assertEquals ;
8
8
9
9
public class _122Test {
10
- private static _122 .Solution1 solution1 ;
11
- private static _122 .Solution2 solution2 ;
12
- private static int [] prices ;
10
+ private static _122 .Solution1 solution1 ;
11
+ private static _122 .Solution2 solution2 ;
12
+ private static int [] prices ;
13
13
14
- @ BeforeClass
15
- public static void setup () {
16
- solution1 = new _122 .Solution1 ();
17
- solution2 = new _122 .Solution2 ();
18
- }
14
+ @ BeforeClass
15
+ public static void setup () {
16
+ solution1 = new _122 .Solution1 ();
17
+ solution2 = new _122 .Solution2 ();
18
+ }
19
19
20
- @ Test
21
- public void test1 () {
22
- prices = new int []{1 , 2 , 4 };
23
- assertEquals (3 , solution1 .maxProfit (prices ));
24
- assertEquals (3 , solution2 .maxProfit (prices ));
25
- }
26
-
27
- }
20
+ @ Test
21
+ public void test1 () {
22
+ prices = new int [] {1 , 2 , 4 };
23
+ assertEquals (3 , solution1 .maxProfit (prices ));
24
+ assertEquals (3 , solution2 .maxProfit (prices ));
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments