The greedy approach: sort children by greed factor, sort cookies by size. For each child in order, give them the smallest cookie that satisfies their greed. This is and simpler than matching. Why does greedy work?
If you give a child a larger cookie than needed, you might waste it. The smallest valid cookie is always the right choice because it preserves larger cookies for greedier children.
Space complexity is for the data structures used.