上一页 1 2 3 4 5 6 ··· 9 下一页
摘要: 7. Reverse Integer Medium Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 阅读全文
posted @ 2023-07-20 23:24 xiaoyongyong 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 1569. Number of Ways to Reorder Array to Get Same BST Hard 1590185Add to ListShare Given an array nums that represents a permutation of integers from  阅读全文
posted @ 2023-06-18 02:29 xiaoyongyong 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(7) 评论(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 阅读(8) 评论(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 阅读(11) 评论(0) 推荐(0) 编辑
摘要: 什么是质数?在一个大于1的自然数中,除了1和此整数自身外,没法被其他自然数整除的数,比如:2,3,5,7,11... 什么是合数?比1大但不是素数的数称为合数。1和0既非素数也非合数。合数是由若干个质数相乘而得到的, 比如:4,6,8,9,10... 如何判定一个数是否位质数? public cla 阅读全文
posted @ 2023-01-03 07:19 xiaoyongyong 阅读(21) 评论(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 阅读(12) 评论(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 阅读(32) 评论(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 阅读(15) 评论(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 阅读(27) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 9 下一页