We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 499d2af commit b05f66dCopy full SHA for b05f66d
problems/0406.根据身高重建队列.md
@@ -396,6 +396,29 @@ object Solution {
396
}
397
398
```
399
+### C#
400
+```csharp
401
+public class Solution
402
+{
403
+ public int[][] ReconstructQueue(int[][] people)
404
+ {
405
+ Array.Sort(people, (a, b) =>
406
407
+ if (a[0] == b[0])
408
409
+ return a[1] - b[1];
410
+ }
411
+ return b[0] - a[0];
412
+ });
413
+ var res = new List<int[]>();
414
+ for (int i = 0; i < people.Length; i++)
415
416
+ res.Insert(people[i][1], people[i]);
417
418
+ return res.ToArray();
419
420
+}
421
+```
422
423
424
<p align="center">
0 commit comments