refactor: remove Java code sections from all LeetCode Hot 100 markdown files
- Remove all "## Java 解法" sections and Java code blocks - Replace "## Go 解法" with "## 解法" - Remove "### Go 代码要点" and "### Java 代码要点" sections - Keep all Go code sections intact - Maintain complete documentation structure and content - Update 22 markdown files in the LeetCode Hot 100 directory
This commit is contained in:
@@ -54,27 +54,6 @@ func largestRectangleArea(heights []int) int {
|
||||
|
||||
### Java 实现
|
||||
|
||||
```java
|
||||
public int largestRectangleArea(int[] heights) {
|
||||
Stack<Integer> stack = new Stack<>();
|
||||
int maxArea = 0;
|
||||
int n = heights.length;
|
||||
|
||||
for (int i = 0; i <= n; i++) {
|
||||
int h = (i == n) ? 0 : heights[i];
|
||||
|
||||
while (!stack.isEmpty() && h < heights[stack.peek()]) {
|
||||
int height = heights[stack.pop()];
|
||||
int width = stack.isEmpty() ? i : i - stack.peek() - 1;
|
||||
maxArea = Math.max(maxArea, height * width);
|
||||
}
|
||||
|
||||
stack.push(i);
|
||||
}
|
||||
|
||||
return maxArea;
|
||||
}
|
||||
```
|
||||
|
||||
## 复杂度分析
|
||||
|
||||
|
||||
Reference in New Issue
Block a user