Fork me on GitHub
摘要: class Solution { public int movesToMakeZigzag(int[] nums) { int temp1[] = new int[nums.length]; int temp2[] = new int[nums.length]; for (int i = 0; i 阅读全文
posted @ 2019-08-04 15:04 cznczai 阅读(293) 评论(0) 推荐(0) 编辑
摘要: ![](https://img2018.cnblogs.com/blog/1648545/201908/1648545-20190804150144609-456398695.png) ``` class Solution { public int maxProfit(int[] prices) { int maxPro = 0, tmp = 0; for (int i ... 阅读全文
posted @ 2019-08-04 15:02 cznczai 阅读(72) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int largest1BorderedSquare(int[][] grid) { int ans = 0; int n = grid.length; int m = grid[0].length; int[][] ud = new int[n][m 阅读全文
posted @ 2019-08-04 14:59 cznczai 阅读(209) 评论(0) 推荐(0) 编辑
摘要: class Solution { public List largeGroupPositions(String S) { List ls = new LinkedList (); for (int i = 0; i l = new LinkedList(); int a = i; int b = i 阅读全文
posted @ 2019-08-04 14:58 cznczai 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 在Python中,代码不是越多越好,而是越少越好。代码不是越复杂越好,而是越简单越好。 1行代码能实现的功能,决不写5行代码。请始终牢记,代码越少,开发效率越高。 切片 tuple也是一种list,唯一区别是tuple不可变。因此,tuple也可以用切片操作,只是操作的结果仍是tuple: 小结 在 阅读全文
posted @ 2019-08-04 10:30 cznczai 阅读(260) 评论(0) 推荐(0) 编辑