Skip to content

Commit 2ff8b23

Browse files
committed
💪(*): 同步数据
2 parents 03346ca + e72efb5 commit 2ff8b23

File tree

2 files changed

+50
-1
lines changed

2 files changed

+50
-1
lines changed

docs/data-structure/array/README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1732,6 +1732,31 @@ func islandPerimeter(grid [][]int) int {
17321732
}
17331733
```
17341734

1735+
#### **Java**
1736+
1737+
```java
1738+
class Solution {
1739+
public int islandPerimeter(int[][] grid) {
1740+
if (grid == null || grid.length <= 0 || grid[0] == null || grid[0].length <= 0) return 0;
1741+
int height = grid.length;
1742+
int width = grid[0].length;
1743+
1744+
int result = 0;
1745+
1746+
for (int i = 0; i < height; i++) {
1747+
for (int j = 0; j < width; j++) {
1748+
if (grid[i][j] == 1) {
1749+
if (i == 0 || grid[i - 1][j] == 0) result++;
1750+
if (j == 0 || grid[i][j - 1] == 0) result++;
1751+
}
1752+
}
1753+
}
1754+
1755+
return result * 2;
1756+
}
1757+
}
1758+
```
1759+
17351760
<!-- tabs:end -->
17361761

17371762
## 485. 最大连续1的个数

docs/index.html

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<style>
1111
:root {
1212
--docsifytabs-border-color: #ededed;
13-
--docsifytabs-tab-highlight-color: purple;
13+
--docsifytabs-tab-highlight-color: #F77F00;
1414
}
1515
</style>
1616
</head>
@@ -43,6 +43,30 @@
4343
tabComments: true,
4444
tabHeadings: true,
4545
},
46+
// 更新日期
47+
formatUpdated: '{YYYY}-{MM}-{DD} {HH}:{mm}:{ss}',
48+
// 插件
49+
plugins: [
50+
function(hook, vm) {
51+
// 底部
52+
hook.beforeEach(function(content) {
53+
var url ='https://github.com/JalanJiang/leetcode-notebook/tree/master/docs/' + vm.route.file;
54+
var editHtml = '> 🧐发现错误,想一起完善?[在 Github 编辑此页](' + url +')!\n'
55+
56+
var footer = [
57+
'----',
58+
'> Last modified {docsify-updated}.',
59+
'> [Jalan](http://jalan.space/), [Csming](https://csming1995.github.io/) &copy;2019. Proudly published with [docsify](https://github.com/docsifyjs/docsify) and powered by love.',
60+
].join("\n");
61+
62+
return editHtml
63+
+ "\n----\n"
64+
+ content
65+
+ "\n\n"
66+
+ footer
67+
})
68+
},
69+
]
4670
}
4771
</script>
4872
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>

0 commit comments

Comments
 (0)