## 方法一:贪心算法 **解题思想:** **代码:** ```js var findContentChildren = function(g, s) { const sortFunc = (a, b) => a - b; g.sort(sortFunc); s.sort(sortFunc); let i = 0; s.forEach(n => { if ( n >= g[i]) { i++; } }); return i; }; ``` **复杂度分析:** - 时间复杂度: - 空间复杂度: