Boats to Save People Solutions in GoNumber 881Difficulty MediumAcceptance 46.9%Link LeetCodeOther languages C++SolutionsGo solution by halfrost/LeetCode-Gopackage leetcode import ( "sort") func numRescueBoats(people []int, limit int) int { sort.Ints(people) left, right, res := 0, len(people)-1, 0 for left <= right { if left == right { res++ return res } if people[left]+people[right] <= limit { left++ right-- } else { right-- } res++ } return res}package leetcode import ( "sort" ) func numRescueBoats(people []int, limit int) int { sort.Ints(people) left, right, res := 0, len(people)-1, 0 for left <= right { if left == right { res++ return res } if people[left]+people[right] <= limit { left++ right-- } else { right-- } res++ } return res }