nums
-
PAT (Advanced Level) Practice 1008 Elevator 分数 20 Python 解法
题目 The highest building in our city has only one elevator. A request list is made up with …
-
第一题,Two Sum
此题给定一个数组和目标target,求两个数之和等于target,返回这两个数的下标位置 Given an array of integers nums and an inte…
-
leetcode之两数相加
// 1.两数之和 // set 存每一位被需要的值,作为key , 值为当前位置的 index // 然后继续遍历下一位,判断下一位是否就是已经存起来的被需要的值 // 如果是,…
-
五大算法之二分搜索
概述 二分搜索是常见的搜索算法,能够将有序数组搜索的线性复杂度降低到对数级别。搜索过程每次取搜索区间内的中间元素,如果等于目标元素则直接返回结果;如果大于或小于目标元素,则将搜…
-
Leetcode的中等算法题:198. 打家劫舍
链接:https://leetcode.cn/problems/house-robber/ 方法1 学会了动态规划思路后,我独立想出来的一个方法,缺点是代码不够优雅(dp和nums…
-
Leetcode的简单算法题:53. 最大子数组和
链接:https://leetcode.cn/problems/maximum-subarray/之前题解的博客:https://tsuish.gitee.io/p/7a78注:之…
-
day30
1.剑指 Offer 17. 打印从 1 到最大的 n 位数 1)直接列举(执行用时比分治短) 1 class Solution { 2 public: 3 vector<…
-
day30
1.剑指 Offer 17. 打印从 1 到最大的 n 位数 1)直接列举(执行用时比分治短) 1 class Solution { 2 public: 3 vector<…
-
LeetCode 215 Kth Largest Element in an Array 数组中的第K大元素
描述 Given an integer array nums and an integer k, return the kth largest element in the arr…
-
移动零
/* leetCode — 移动零 */ public class Remove_zero { public static void main(String[] args) { …