diff --git a/problems/0455.分发饼干.md b/problems/0455.分发饼干.md index c9c1a852..778adc94 100644 --- a/problems/0455.分发饼干.md +++ b/problems/0455.分发饼干.md @@ -378,6 +378,28 @@ object Solution { } } ``` +### C# +```csharp +public class Solution +{ + public int FindContentChildren(int[] g, int[] s) + { + Array.Sort(g); + Array.Sort(s); + int index = s.Length - 1; + int res = 0; + for (int i = g.Length - 1; i >=0; i--) + { + if(index >=0 && s[index]>=g[i]) + { + res++; + index--; + } + } + return res; + } +} +```