@@ -11,19 +11,19 @@ void testLargestRectangleHistogramWithTypicalCases() {
11
11
// Typical case with mixed heights
12
12
int [] heights = {2 , 1 , 5 , 6 , 2 , 3 };
13
13
String expected = "10" ;
14
- String result = LargestRectangle .largestRectanglehistogram (heights );
14
+ String result = LargestRectangle .largestRectangleHistogram (heights );
15
15
assertEquals (expected , result );
16
16
17
17
// Another typical case with increasing heights
18
18
heights = new int [] {2 , 4 };
19
19
expected = "4" ;
20
- result = LargestRectangle .largestRectanglehistogram (heights );
20
+ result = LargestRectangle .largestRectangleHistogram (heights );
21
21
assertEquals (expected , result );
22
22
23
23
// Case with multiple bars of the same height
24
24
heights = new int [] {4 , 4 , 4 , 4 };
25
25
expected = "16" ;
26
- result = LargestRectangle .largestRectanglehistogram (heights );
26
+ result = LargestRectangle .largestRectangleHistogram (heights );
27
27
assertEquals (expected , result );
28
28
}
29
29
@@ -32,19 +32,19 @@ void testLargestRectangleHistogramWithEdgeCases() {
32
32
// Edge case with an empty array
33
33
int [] heights = {};
34
34
String expected = "0" ;
35
- String result = LargestRectangle .largestRectanglehistogram (heights );
35
+ String result = LargestRectangle .largestRectangleHistogram (heights );
36
36
assertEquals (expected , result );
37
37
38
38
// Edge case with a single bar
39
39
heights = new int [] {5 };
40
40
expected = "5" ;
41
- result = LargestRectangle .largestRectanglehistogram (heights );
41
+ result = LargestRectangle .largestRectangleHistogram (heights );
42
42
assertEquals (expected , result );
43
43
44
44
// Edge case with all bars of height 0
45
45
heights = new int [] {0 , 0 , 0 };
46
46
expected = "0" ;
47
- result = LargestRectangle .largestRectanglehistogram (heights );
47
+ result = LargestRectangle .largestRectangleHistogram (heights );
48
48
assertEquals (expected , result );
49
49
}
50
50
@@ -56,7 +56,7 @@ void testLargestRectangleHistogramWithLargeInput() {
56
56
heights [i ] = 1 ;
57
57
}
58
58
String expected = "10000" ;
59
- String result = LargestRectangle .largestRectanglehistogram (heights );
59
+ String result = LargestRectangle .largestRectangleHistogram (heights );
60
60
assertEquals (expected , result );
61
61
}
62
62
@@ -65,13 +65,13 @@ void testLargestRectangleHistogramWithComplexCases() {
65
65
// Complex case with a mix of heights
66
66
int [] heights = {6 , 2 , 5 , 4 , 5 , 1 , 6 };
67
67
String expected = "12" ;
68
- String result = LargestRectangle .largestRectanglehistogram (heights );
68
+ String result = LargestRectangle .largestRectangleHistogram (heights );
69
69
assertEquals (expected , result );
70
70
71
71
// Case with a peak in the middle
72
72
heights = new int [] {2 , 1 , 5 , 6 , 2 , 3 , 1 };
73
73
expected = "10" ;
74
- result = LargestRectangle .largestRectanglehistogram (heights );
74
+ result = LargestRectangle .largestRectangleHistogram (heights );
75
75
assertEquals (expected , result );
76
76
}
77
77
}
0 commit comments