贪心算法
文章平均质量分 86
贪心
河海哥yyds
正经人谁写代码吖!哦对了,我没说我是正经人。
展开
-
Java描述 LeetCode,621. 任务调度器
关键是如何判断是否有间隙原创 2022-04-21 19:39:29 · 217 阅读 · 0 评论 -
Java描述 LeetCode,738. Monotone Increasing Digits 单调递增的数字
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。一起支持原创吧!纯手打有笔误还望谅解。1-1:题目An integer has monotone increasing digits if and only if each pair of adjacent digits x and y satisfy x <= y.Given an integer n, r.原创 2021-12-13 15:33:57 · 537 阅读 · 0 评论 -
Java描述 LeetCode,763. Partition Labels 字符区间
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。一起支持原创吧!纯手打有笔误还望谅解。1-1:题目You are given a string s. We want to partition the string into as many parts as possible so that each letter appears in at most one pa.原创 2021-12-11 17:44:29 · 415 阅读 · 0 评论 -
Java描述 LeetCode,435. Non-overlapping Intervals 不重复的间隔
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。一起支持原创吧!纯手打有笔误还望谅解。1-1:题目Given an array of intervals intervals where intervals[i] = [starti, endi], return the minimum number of intervals you need to remove t.原创 2021-12-07 22:28:31 · 530 阅读 · 0 评论 -
Java描述 LeetCode,452. Minimum Number of Arrows to Burst Balloons 用最少的箭打破气球
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。一起支持原创吧!纯手打有笔误还望谅解。1-1:题目There are some spherical balloons taped onto a flat wall that represents the XY-plane. The balloons are represented as a 2D integer ar.原创 2021-12-07 19:01:04 · 170 阅读 · 0 评论 -
Java描述 LeetCode,406. Queue Reconstruction by Height 根据个子重新排队
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。一起支持原创吧!纯手打有笔误还望谅解。1-1:题目You are given an array of people, people, which are the attributes of some people in a queue (not necessarily in order). Each people[i.原创 2021-12-06 22:59:39 · 222 阅读 · 0 评论 -
Java描述 LeetCode,135. Candy 分发糖果
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。一起支持原创吧!纯手打有笔误还望谅解。1-1:题目There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings.You are giving cand.原创 2021-12-05 23:03:44 · 351 阅读 · 0 评论 -
Java描述 LeetCode,134. Gas Station 加油站问题
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。一起支持原创吧!纯手打有笔误还望谅解。1-1:题目There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i].You have a car with an unlimite.原创 2021-12-04 17:06:56 · 795 阅读 · 0 评论 -
Java描述 LeetCode,45. Jump Game II 跳跃游戏II
1-1:题目Given an array of non-negative integers nums, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal is to reach the last index in the minimum number of原创 2021-12-02 23:22:21 · 462 阅读 · 0 评论 -
Java描述 LeetCode,55. Jump Game 跳跃游戏
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。一起支持原创吧!1-1:题目You are given an integer array nums. You are initially positioned at the array’s first index, and each element in the array represents your maxim.原创 2021-11-30 19:37:42 · 3394 阅读 · 1 评论 -
Java描述 LeetCode,122. Best Time to Buy and Sell Stock II(买卖股票的时机II)
1-1:题目You are given an integer array prices where prices[i] is the price of a given stock on the ith day.On each day, you may decide to buy and/or sell the stock. You can only hold at most one share of the stock at any time. However, you can buy it then原创 2021-10-29 17:15:03 · 149 阅读 · 0 评论 -
Java描述 LeetCode,300. Longest Increasing Subsequence,并且输出最小的
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力。1-1:题目Given an integer array nums, return the length of the longest strictly increasing subsequence.A subsequence is a sequence that can be derived from an array by deleting .原创 2021-11-08 10:43:50 · 184 阅读 · 0 评论 -
Java描述 LeetCode,53. Maximum Subarray,最大连续子数组之和
动态规划,贪心算法,分治,三种方法解决问题原创 2021-11-11 10:03:49 · 474 阅读 · 0 评论 -
Java描述 LeetCode,376. Wiggle Subsequence 摇摆序列
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。1-1:题目A wiggle sequence is a sequence where the differences between successive numbers strictly alternate between positive and negative. The first difference (.原创 2021-11-18 22:11:59 · 503 阅读 · 0 评论 -
Java描述 LeetCode,409. Longest Palindrome 最长回文
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。1-1:题目Given a string s which consists of lowercase or uppercase letters, return the length of the longest palindrome that can be built with those letters.Lett.原创 2021-11-17 23:00:57 · 286 阅读 · 0 评论 -
Java描述 LeetCode,561. Array Partition I 数组拆分i
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。1-1:题目Given an integer array nums of 2n integers, group these integers into n pairs (a1, b1), (a2, b2), …, (an, bn) such that the sum of min(ai, bi) for all i .原创 2021-11-17 20:29:53 · 248 阅读 · 0 评论 -
Java描述 LeetCode,455. Assign Cookies 分配饼干
大家好,我是河海哥,专注于后端,如果可以的话,想做一名code designer而不是普通的coder,一起见证河海哥的成长,您的评论与赞是我的最大动力,如有错误还请不吝赐教,万分感谢。1-1:题目Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.Each child i has a gree.原创 2021-11-17 10:39:35 · 295 阅读 · 0 评论