上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 52 下一页
摘要: 1 题目 在一条环路上有 n 个加油站,其中第 i 个加油站有汽油 gas[i] 升。 你有一辆油箱容量无限的的汽车,从第 i 个加油站开往第 i+1 个加油站需要消耗汽油 cost[i] 升。你从其中的一个加油站出发,开始时油箱为空。 给定两个整数数组 gas 和 cost ,如果你可以按顺序绕环 阅读全文
posted @ 2024-01-04 09:07 酷酷- 阅读(28) 评论(0) 推荐(0)
摘要: 1 题目 给定一个 m x n 的矩阵,如果一个元素为 0 ,则将其所在行和列的所有元素都设为 0 。请使用 原地 算法。 示例 1: 输入:matrix = [[1,1,1],[1,0,1],[1,1,1]] 输出:[[1,0,1],[0,0,0],[1,0,1]] 示例 2: 输入:matrix 阅读全文
posted @ 2024-01-03 06:39 酷酷- 阅读(68) 评论(0) 推荐(0)
摘要: 1 题目 An n-bit gray code sequence is a sequence of 2n integers where: Every integer is in the inclusive range [0, 2n - 1], The first integer is 0, An i 阅读全文
posted @ 2024-01-02 06:58 酷酷- 阅读(36) 评论(0) 推荐(0)
摘要: 1 前言 前端包一般都是打包好后,放置在Nginx里,这节我们就来安装下。 http://nginx.org/en/download.html 2 安装步骤 2.1 下载压缩包 下载地址:http://nginx.org/en/download.html 2.2 解压 tar -zxvf nginx 阅读全文
posted @ 2024-01-01 16:40 酷酷- 阅读(433) 评论(0) 推荐(0)
摘要: 1 题目 假设你正在爬楼梯,需要n步你才能到达顶部。但每次你只能爬一步或者两步,爬到顶部的方法有多少种? 样例 1: 输入: n = 3 输出: 3 解释:共3种 1, 1, 1 1, 2 2, 1 样例 2: 输入: n = 1 输出: 1 解释:只有一种方案 2 解答 错误的想法: class 阅读全文
posted @ 2023-12-29 07:14 酷酷- 阅读(18) 评论(0) 推荐(0)
摘要: 1 题目 You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordere 阅读全文
posted @ 2023-12-28 06:55 酷酷- 阅读(28) 评论(0) 推荐(0)
摘要: 1 题目 给定一个 n × n 的二维矩阵 matrix 表示一个图像。请你将图像顺时针旋转 90 度。 你必须在 原地 旋转图像,这意味着你需要直接修改输入的二维矩阵。请不要 使用另一个矩阵来旋转图像。 示例 1: 输入:matrix = [[1,2,3],[4,5,6],[7,8,9]] 输出: 阅读全文
posted @ 2023-12-27 07:46 酷酷- 阅读(43) 评论(0) 推荐(0)
摘要: 1 题目 Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. I 阅读全文
posted @ 2023-12-26 07:24 酷酷- 阅读(21) 评论(0) 推荐(0)
摘要: 1 小技巧 // 数字 char 怎么得到它的 int char c = '5'; int num = c - '0' + 1; 2 思想 2.1 给定数的下一个接近的数 比如 241532 的下一个数 242135,主要是思想,从右往左找到第一个出现降序的,找到 15,然后从右边找到第一个比 1 阅读全文
posted @ 2023-12-26 07:20 酷酷- 阅读(33) 评论(0) 推荐(0)
摘要: 1 题目 请你判断一个 9 x 9 的数独是否有效。只需要 根据以下规则 ,验证已经填入的数字是否有效即可。 数字 1-9 在每一行只能出现一次。 数字 1-9 在每一列只能出现一次。 数字 1-9 在每一个以粗实线分隔的 3x3 宫内只能出现一次。(请参考示例图) 注意: 一个有效的数独(部分已被 阅读全文
posted @ 2023-12-25 06:48 酷酷- 阅读(23) 评论(0) 推荐(0)
上一页 1 ··· 11 12 13 14 15 16 17 18 19 ··· 52 下一页