Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add cs solution to lc problem: No.1424 #1998

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update README.md to lc problem: No.1424
  • Loading branch information
dev-mauli authored Nov 22, 2023
commit 50334dde0dcd8d2ec3baf14b3f0dd9b8da561e7d
21 changes: 21 additions & 0 deletions solution/1400-1499/1424.Diagonal Traverse II/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,27 @@ func findDiagonalOrder(nums [][]int) []int {
}
```

### **C#**

```cs
public class Solution {
public int[] FindDiagonalOrder(IList<IList<int>> nums) {
List<int[]> arr = new List<int[]>();
for (int i = 0; i < nums.Count; ++i) {
for (int j = 0; j < nums[i].Count; ++j) {
arr.Add(new int[] { i + j, j, nums[i][j] });
}
}
arr.Sort((a, b) => a[0] == b[0] ? a[1] - b[1] : a[0] - b[0]);
int[] ans = new int[arr.Count];
for (int i = 0; i < arr.Count; ++i) {
ans[i] = arr[i][2];
}
return ans;
}
}
```

### **...**

```
Expand Down