上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: 1351. Count Negative Numbers in a Sorted Matrix Easy 338393Add to ListShare Given a m x n matrix grid which is sorted in non-increasing order both row 阅读全文
posted @ 2023-06-08 09:47 xiaoyongyong 阅读(22) 评论(0) 推荐(0)
摘要: 如何求取两个数字的最大公约数? 原理:a和b的最大公约数,也是a和a%b的最大公约数 private int gcd(int a, int b) { //如果b为0,那么直接返回a if(b == 0) return a; //如果a可以被b整除,那么返回b if(a % b == 0) retur 阅读全文
posted @ 2023-04-24 01:37 xiaoyongyong 阅读(26) 评论(0) 推荐(0)
摘要: 1438. Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Medium 2790115Add to ListShare Given an array of integers nums and an 阅读全文
posted @ 2023-01-27 13:52 xiaoyongyong 阅读(24) 评论(0) 推荐(0)
摘要: 什么是质数?在一个大于1的自然数中,除了1和此整数自身外,没法被其他自然数整除的数,比如:2,3,5,7,11... 什么是合数?比1大但不是素数的数称为合数。1和0既非素数也非合数。合数是由若干个质数相乘而得到的, 比如:4,6,8,9,10... 如何判定一个数是否位质数? 时间复杂度:O(sq 阅读全文
posted @ 2023-01-03 07:19 xiaoyongyong 阅读(49) 评论(0) 推荐(0)
摘要: 834. Sum of Distances in Tree Hard There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges. You are given the integ 阅读全文
posted @ 2022-12-30 02:55 xiaoyongyong 阅读(20) 评论(0) 推荐(0)
摘要: 1359. Count All Valid Pickup and Delivery Options Hard 1674150Add to ListShare Given n orders, each order consist in pickup and delivery services. Cou 阅读全文
posted @ 2022-11-29 14:15 xiaoyongyong 阅读(45) 评论(0) 推荐(0)
摘要: 数据库:append only 何为数据库?写个shell脚本,set的时候追加纪录,get的时候grep and tail 最新纪录,即为一个数据库#!/bin/bashdb_set () { echo "$1,$2" >> database} db_get () { grep "^$1," da 阅读全文
posted @ 2022-11-03 11:30 xiaoyongyong 阅读(29) 评论(0) 推荐(0)
摘要: 2246. Longest Path With Different Adjacent Characters Hard You are given a tree (i.e. a connected, undirected graph that has no cycles) rooted at node 阅读全文
posted @ 2022-10-31 11:46 xiaoyongyong 阅读(44) 评论(0) 推荐(0)
摘要: 864. Shortest Path to Get All Keys You are given an m x n grid grid where: '.' is an empty cell. '#' is a wall. '@' is the starting point. Lowercase l 阅读全文
posted @ 2022-10-23 12:31 xiaoyongyong 阅读(26) 评论(0) 推荐(0)
摘要: csrf 攻击的预防: 1.敏感操作api尽量不使用get请求,原因:容易伪造 2.验证码二次验证,用户发送请求时,要求短信验证码验证,确保是人为操作 3.检查refer,浏览器发送请求到服务端的时候,会带上refer 字段(请求来自哪个url),如果refer传过来的domain和当前网站不同,那 阅读全文
posted @ 2022-10-23 01:39 xiaoyongyong 阅读(40) 评论(0) 推荐(0)
上一页 1 2 3 4 5 6 7 ··· 10 下一页