前言: 总听前辈们说刷题有助于提高数据水平,于是我来了!!!! leetcode-cn.com/problems/as…
var findContentChildren = function(g, s) { g.sort(function(a, b) { return a - b; }) s.sort(function(a, b) { return a - b; }) let count = 0, j=0 while(count < g.length && j< s.length) { if(g[count] <= s[j]){++count} ++j } return count }; undefined findContentChildren(g, s)