style: use proper spelling (#5436)

checkstyle: fix typos, style

Co-authored-by: alxkm <alx@alx.com>
Co-authored-by: Piotr Idzik <65706193+vil02@users.noreply.github.com>
This commit is contained in:
Alex Klymenko
2024-08-30 08:50:14 +02:00
committed by GitHub
parent d189c3a719
commit 87cf89192b
7 changed files with 18 additions and 19 deletions

View File

@ -11,19 +11,19 @@ public class LargestRectangleTest {
// Typical case with mixed heights
int[] heights = {2, 1, 5, 6, 2, 3};
String expected = "10";
String result = LargestRectangle.largestRectanglehistogram(heights);
String result = LargestRectangle.largestRectangleHistogram(heights);
assertEquals(expected, result);
// Another typical case with increasing heights
heights = new int[] {2, 4};
expected = "4";
result = LargestRectangle.largestRectanglehistogram(heights);
result = LargestRectangle.largestRectangleHistogram(heights);
assertEquals(expected, result);
// Case with multiple bars of the same height
heights = new int[] {4, 4, 4, 4};
expected = "16";
result = LargestRectangle.largestRectanglehistogram(heights);
result = LargestRectangle.largestRectangleHistogram(heights);
assertEquals(expected, result);
}
@ -32,19 +32,19 @@ public class LargestRectangleTest {
// Edge case with an empty array
int[] heights = {};
String expected = "0";
String result = LargestRectangle.largestRectanglehistogram(heights);
String result = LargestRectangle.largestRectangleHistogram(heights);
assertEquals(expected, result);
// Edge case with a single bar
heights = new int[] {5};
expected = "5";
result = LargestRectangle.largestRectanglehistogram(heights);
result = LargestRectangle.largestRectangleHistogram(heights);
assertEquals(expected, result);
// Edge case with all bars of height 0
heights = new int[] {0, 0, 0};
expected = "0";
result = LargestRectangle.largestRectanglehistogram(heights);
result = LargestRectangle.largestRectangleHistogram(heights);
assertEquals(expected, result);
}
@ -56,7 +56,7 @@ public class LargestRectangleTest {
heights[i] = 1;
}
String expected = "10000";
String result = LargestRectangle.largestRectanglehistogram(heights);
String result = LargestRectangle.largestRectangleHistogram(heights);
assertEquals(expected, result);
}
@ -65,13 +65,13 @@ public class LargestRectangleTest {
// Complex case with a mix of heights
int[] heights = {6, 2, 5, 4, 5, 1, 6};
String expected = "12";
String result = LargestRectangle.largestRectanglehistogram(heights);
String result = LargestRectangle.largestRectangleHistogram(heights);
assertEquals(expected, result);
// Case with a peak in the middle
heights = new int[] {2, 1, 5, 6, 2, 3, 1};
expected = "10";
result = LargestRectangle.largestRectanglehistogram(heights);
result = LargestRectangle.largestRectangleHistogram(heights);
assertEquals(expected, result);
}
}