Skip to content

Commit

Permalink
modify code
Browse files Browse the repository at this point in the history
  • Loading branch information
algorithmzuo committed Dec 2, 2021
1 parent 0523a57 commit 0afe2d7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions 课堂笔记/大厂刷题班
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ hp[i]表示i号怪兽的血量

给定一个正数数组arr,代表若干人的体重,再给定一个正数limit,表示所有船共同拥有的载重量,每艘船最多坐两人,且不能超过载重
想让所有的人同时过河,并且用最好的分配方法让船尽量少,返回最少的船数
Leetcode链接 : https://leetcode.com/problems/boats-to-save-people/

给定整数数组nums和目标值goal,需要从nums中选出一个子序列,使子序列元素总和最接近goal
也就是说如果子序列元素和为sum ,需要最小化绝对差abs(sum - goal),返回 abs(sum - goal)可能的最小值
Expand Down

0 comments on commit 0afe2d7

Please sign in to comment.