leetcode 455. Assign Cookies

    xiaoxiao2021-03-25  173

    public class Solution { public int findContentChildren(int[] g, int[] s) { Arrays.sort(g); Arrays.sort(s); int idxG = 0, idxS = 0; while(idxG<g.length && idxS < s.length ) { if (g[idxG]<=s[idxS]) { idxG ++; idxS ++; } else idxS ++; } return idxG; } }
    转载请注明原文地址: https://ju.6miu.com/read-3069.html

    最新回复(0)