Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4e0ec1f

Browse files
Merge pull request youngyangyang04#2397 from eeee0717/master
Update0406.根据身高重建队列,添加C#
2 parents c79f957 + f292cba commit 4e0ec1f

File tree

47 files changed

+213
-50
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+213
-50
lines changed

‎problems/0005.最长回文子串.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ char * longestPalindrome(char * s){
618618
### C#:
619619

620620
動態規則:
621-
```c#
621+
```csharp
622622
public class Solution {
623623

624624
public string LongestPalindrome(string s) {
@@ -648,7 +648,7 @@ public class Solution {
648648
```
649649

650650
雙指針:
651-
```C#
651+
```csharp
652652
public class Solution {
653653
int maxlenth = 0;
654654
int left = 0;

‎problems/0017.电话号码的字母组合.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ def backtracking(result, letter_map, digits, path, index)
733733
end
734734
```
735735
### C#
736-
```C#
736+
```csharp
737737
public class Solution
738738
{
739739
public IList<string> res = new List<string>();

‎problems/0024.两两交换链表中的节点.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ impl Solution {
462462
```
463463

464464
### C#
465-
```C#
465+
```csharp
466466
// 虚拟头结点
467467
public ListNode SwapPairs(ListNode head)
468468
{

‎problems/0028.实现strStr.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1359,7 +1359,7 @@ impl Solution {
13591359
```
13601360

13611361
>前缀表统一不减一
1362-
```C#
1362+
```csharp
13631363
public int StrStr(string haystack, string needle)
13641364
{
13651365
if (string.IsNullOrEmpty(needle))

‎problems/0034.在排序数组中查找元素的第一个和最后一个位置.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ class Solution {
331331

332332
### C#
333333

334-
```c#
334+
```csharp
335335
public int[] SearchRange(int[] nums, int target) {
336336

337337
var leftBorder = GetLeftBorder(nums, target);

‎problems/0056.合并区间.md‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,32 @@ impl Solution {
336336
}
337337
}
338338
```
339+
### C#
340+
```csharp
341+
public class Solution
342+
{
343+
public int[][] Merge(int[][] intervals)
344+
{
345+
if (intervals.Length == 0)
346+
return intervals;
347+
Array.Sort(intervals, (a, b) => a[0] - b[0]);
348+
List<List<int>> res = new List<List<int>>();
349+
res.Add(intervals[0].ToList());
350+
for (int i = 1; i < intervals.Length; i++)
351+
{
352+
if (res[res.Count - 1][1] >= intervals[i][0])
353+
{
354+
res[res.Count - 1][1] = Math.Max(res[res.Count - 1][1], intervals[i][1]);
355+
}
356+
else
357+
{
358+
res.Add(intervals[i].ToList());
359+
}
360+
}
361+
return res.Select(x => x.ToArray()).ToArray();
362+
}
363+
}
364+
```
339365

340366
<p align="center">
341367
<a href="https://programmercarl.com/other/kstar.html" target="_blank">

‎problems/0062.不同路径.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ object Solution {
537537

538538
### c#
539539

540-
```c#
540+
```csharp
541541
public class Solution
542542
{
543543
public int UniquePaths(int m, int n)

‎problems/0070.爬楼梯.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ object Solution {
468468

469469
### C#
470470

471-
```c#
471+
```csharp
472472
public class Solution {
473473
public int ClimbStairs(int n) {
474474
if(n<=2) return n;

‎problems/0077.组合.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,7 @@ end
793793

794794
```
795795
### C#
796-
```C#
796+
```csharp
797797
// 暴力
798798
public class Solution
799799
{

‎problems/0090.子集II.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ object Solution {
641641
}
642642
```
643643
### C#
644-
```c#
644+
```csharp
645645
public class Solution
646646
{
647647
public IList<IList<int>> res = new List<IList<int>>();

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /