摘要: 问题: 给定由0,1构成的数组,求由1构成的(各种长度边长的)正方形的总个数有多少。 Example 1: Input: matrix = [ [0,1,1,1], [1,1,1,1], [0,1,1,1] ] Output: 15 Explanation: There are 10 squares 阅读全文
posted @ 2020-06-29 19:49 habibah_chang 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 问题: 替换当前元素为,当前元素以后元素的最大值。 最后一个元素替换为-1。 Example 1: Input: arr = [17,18,5,4,6,1] Output: [18,6,6,6,1,-1] Constraints: 1 <= arr.length <= 10^4 1 <= arr[i 阅读全文
posted @ 2020-06-29 14:30 habibah_chang 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 问题: 给定一个服务器所在位置的数组,1代表有一个服务器,0代表没有 若多个服务器,在一行or在一列,则说这些服务器互相连接。 求互相连接的服务器有多少台。 Example 1: Input: grid = [[1,0],[0,1]] Output: 0 Explanation: No server 阅读全文
posted @ 2020-06-29 13:01 habibah_chang 阅读(126) 评论(0) 推荐(0) 编辑