上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页
摘要: leetcode 每日一题 1108. IP 地址无效化 1. replaceAll 字符串替换,支持正则表达式 class Solution { public String defangIPaddr(String address) { return address.replaceAll("\\." 阅读全文
posted @ 2022-06-21 14:35 java架构师1 阅读(26) 评论(0) 推荐(0)
摘要: leetcode 每日一题 1089. 复写零 func duplicateZeros(arr []int) { for i := 0; i < len(arr); i++ { if arr[i] != 0 { continue } for j := len(arr) - 2 ; j > i ; j 阅读全文
posted @ 2022-06-17 08:59 java架构师1 阅读(26) 评论(0) 推荐(0)
摘要: leetcode 每日一题 926. 将字符串翻转到单调递增 func minFlipsMonoIncr(s string) int { var dp0,dp1 int for _,data := range s { i := int(data) dp1 = min(dp0,dp1) + ('1' 阅读全文
posted @ 2022-06-13 17:32 java架构师1 阅读(32) 评论(0) 推荐(0)
摘要: leetcode 每日一题 1051. 高度检查器 import ( "sort" ) func heightChecker(heights []int) int { var num = 0 src := heights dst := make([]int, len(src)) copy(dst, 阅读全文
posted @ 2022-06-13 09:45 java架构师1 阅读(25) 评论(0) 推荐(0)
摘要: leetcode 每日一题 1037. 有效的回旋镖 百度搜了个两点一线方程公式,然后把3个点带入计算,一直出错,后来发现公式错误,用go语言自己写了个简单的判断 func isBoomerang(points [][]int) bool { ax,ay := points[0][0],points 阅读全文
posted @ 2022-06-08 10:31 java架构师1 阅读(26) 评论(0) 推荐(0)
摘要: leetcode 每日一题 464. 我能赢吗 class Solution { Map<Integer, Boolean> memo = new HashMap<Integer, Boolean>(); public boolean canIWin(int maxChoosableInteger, 阅读全文
posted @ 2022-06-08 09:24 java架构师1 阅读(40) 评论(0) 推荐(0)
摘要: leetcode 每日一题 450. 删除二叉搜索树中的节点 class Solution { public TreeNode deleteNode(TreeNode root, int key) { if(root == null){ return null; } if(key == root.v 阅读全文
posted @ 2022-06-02 14:16 java架构师1 阅读(31) 评论(0) 推荐(0)
摘要: leetcode 每日一题 473. 火柴拼正方形 class Solution { int ave = 0; int num = 4; public boolean makesquare(int[] matchsticks) { int sum = 0; for (int matchstick : 阅读全文
posted @ 2022-06-02 08:48 java架构师1 阅读(43) 评论(0) 推荐(0)
摘要: mysql 操作json 1.根据json字段值查询结果 2.修改json中的字段值 阅读全文
posted @ 2022-05-31 17:11 java架构师1 阅读(99) 评论(0) 推荐(0)
摘要: leetcode 每日一题 1022. 从根到叶的二进制数之和 class Solution { int sum = 0; public int sumRootToLeaf(TreeNode root) { f(root, 0); return sum; } private void f(TreeN 阅读全文
posted @ 2022-05-30 10:49 java架构师1 阅读(57) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页