Skip to content

Commit

Permalink
fix: 修复C#代码高亮问题
Browse files Browse the repository at this point in the history
  • Loading branch information
eeee0717 committed Jan 4, 2024
1 parent b05f66d commit 709b5ba
Show file tree
Hide file tree
Showing 40 changed files with 50 additions and 50 deletions.
4 changes: 2 additions & 2 deletions problems/0005.最长回文子串.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ char * longestPalindrome(char * s){
### C#:

動態規則:
```c#
```csharp
public class Solution {

public string LongestPalindrome(string s) {
Expand Down Expand Up @@ -648,7 +648,7 @@ public class Solution {
```

雙指針:
```C#
```csharp
public class Solution {
int maxlenth = 0;
int left = 0;
Expand Down
2 changes: 1 addition & 1 deletion problems/0017.电话号码的字母组合.md
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ def backtracking(result, letter_map, digits, path, index)
end
```
### C#
```C#
```csharp
public class Solution
{
public IList<string> res = new List<string>();
Expand Down
2 changes: 1 addition & 1 deletion problems/0024.两两交换链表中的节点.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ impl Solution {
```

### C#
```C#
```csharp
// 虚拟头结点
public ListNode SwapPairs(ListNode head)
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0028.实现strStr.md
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ impl Solution {
```

>前缀表统一不减一
```C#
```csharp
public int StrStr(string haystack, string needle)
{
if (string.IsNullOrEmpty(needle))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ class Solution {

### C#

```c#
```csharp
public int[] SearchRange(int[] nums, int target) {

var leftBorder = GetLeftBorder(nums, target);
Expand Down
2 changes: 1 addition & 1 deletion problems/0062.不同路径.md
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ object Solution {

### c#

```c#
```csharp
public class Solution
{
public int UniquePaths(int m, int n)
Expand Down
2 changes: 1 addition & 1 deletion problems/0070.爬楼梯.md
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ object Solution {

### C#

```c#
```csharp
public class Solution {
public int ClimbStairs(int n) {
if(n<=2) return n;
Expand Down
2 changes: 1 addition & 1 deletion problems/0077.组合.md
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@ end

```
### C#
```C#
```csharp
// 暴力
public class Solution
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0090.子集II.md
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ object Solution {
}
```
### C#
```c#
```csharp
public class Solution
{
public IList<IList<int>> res = new List<IList<int>>();
Expand Down
2 changes: 1 addition & 1 deletion problems/0098.验证二叉搜索树.md
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归
public long val = Int64.MinValue;
public bool IsValidBST(TreeNode root)
Expand Down
2 changes: 1 addition & 1 deletion problems/0101.对称二叉树.md
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归
public bool IsSymmetric(TreeNode root)
{
Expand Down
4 changes: 2 additions & 2 deletions problems/0102.二叉树的层序遍历.md
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
public IList<IList<int>> LevelOrder(TreeNode root)
{
var res = new List<IList<int>>();
Expand Down Expand Up @@ -825,7 +825,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
public IList<IList<int>> LevelOrderBottom(TreeNode root)
{
var res = new List<IList<int>>();
Expand Down
6 changes: 3 additions & 3 deletions problems/0104.二叉树的最大深度.md
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归法
public int MaxDepth(TreeNode root) {
if(root == null) return 0;
Expand All @@ -1044,7 +1044,7 @@ public int MaxDepth(TreeNode root) {
return 1 + Math.Max(leftDepth, rightDepth);
}
```
```C#
```csharp
// 前序遍历
int result = 0;
public int MaxDepth(TreeNode root)
Expand All @@ -1065,7 +1065,7 @@ public void GetDepth(TreeNode root, int depth)
return;
}
```
```C#
```csharp
// 迭代法
public int MaxDepth(TreeNode root)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
public TreeNode BuildTree(int[] inorder, int[] postorder)
{
if (inorder.Length == 0 || postorder.Length == null) return null;
Expand Down
2 changes: 1 addition & 1 deletion problems/0110.平衡二叉树.md
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
public bool IsBalanced(TreeNode root)
{
return GetHeight(root) == -1 ? false : true;
Expand Down
4 changes: 2 additions & 2 deletions problems/0111.二叉树的最小深度.md
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归
public int MinDepth(TreeNode root)
{
Expand All @@ -725,7 +725,7 @@ public int MinDepth(TreeNode root)
return res;
}
```
```C#
```csharp
// 迭代
public int MinDepth(TreeNode root)
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0112.路径总和.md
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ impl Solution {

```
### C#
```C#
```csharp
// 0112.路径总和
// 递归
public bool HasPathSum(TreeNode root, int targetSum)
Expand Down
2 changes: 1 addition & 1 deletion problems/0151.翻转字符串里的单词.md
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,7 @@ char * reverseWords(char * s){
```
### C#
```C# LINQ高级方法
```csharp LINQ高级方法
public string ReverseWords(string s) {
return string.Join(' ', s.Trim().Split(' ',StringSplitOptions.RemoveEmptyEntries).Reverse());
}
Expand Down
2 changes: 1 addition & 1 deletion problems/0222.完全二叉树的节点个数.md
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归
public int CountNodes(TreeNode root)
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0235.二叉搜索树的最近公共祖先.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归
public TreeNode LowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q)
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0236.二叉树的最近公共祖先.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
public TreeNode LowestCommonAncestor(TreeNode root, TreeNode p, TreeNode q)
{
if (root == null || root == p || root == q) return root;
Expand Down
2 changes: 1 addition & 1 deletion problems/0257.二叉树的所有路径.md
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
public IList<string> BinaryTreePaths(TreeNode root)
{
List<int> path = new();
Expand Down
2 changes: 1 addition & 1 deletion problems/0404.左叶子之和.md
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归
public int SumOfLeftLeaves(TreeNode root)
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0450.删除二叉搜索树中的节点.md
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,7 @@ impl Solution {
### C#

> 递归法:
```C#
```csharp
public TreeNode DeleteNode(TreeNode root, int key) {
// 第一种情况:没找到删除的节点,遍历到空节点直接返回了
if (root == null) return null;
Expand Down
2 changes: 1 addition & 1 deletion problems/0459.重复的子字符串.md
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 前缀表不减一
public bool RepeatedSubstringPattern(string s)
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0501.二叉搜索树中的众数.md
Original file line number Diff line number Diff line change
Expand Up @@ -1010,7 +1010,7 @@ pub fn find_mode(root: Option<Rc<RefCell<TreeNode>>>) -> Vec<i32> {
}
```
### C#
```C#
```csharp
// 递归
public class Solution
{
Expand Down
4 changes: 2 additions & 2 deletions problems/0509.斐波那契数.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ object Solution {

动态规划:

```c#
```csharp
public class Solution
{
public int Fib(int n)
Expand All @@ -459,7 +459,7 @@ public class Solution

递归:

```c#
```csharp
public class Solution
{
public int Fib(int n)
Expand Down
2 changes: 1 addition & 1 deletion problems/0513.找树左下角的值.md
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
//递归
int maxDepth = -1;
int res = 0;
Expand Down
2 changes: 1 addition & 1 deletion problems/0530.二叉搜索树的最小绝对差.md
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归
public class Solution
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0538.把二叉搜索树转换为累加树.md
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归
public class Solution
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0617.合并二叉树.md
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
public TreeNode MergeTrees(TreeNode root1, TreeNode root2)
{
if (root1 == null) return root2;
Expand Down
2 changes: 1 addition & 1 deletion problems/0654.最大二叉树.md
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
public TreeNode ConstructMaximumBinaryTree(int[] nums)
{
if (nums.Length == 0) return null;
Expand Down
2 changes: 1 addition & 1 deletion problems/0669.修剪二叉搜索树.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归
public TreeNode TrimBST(TreeNode root, int low, int high)
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0700.二叉搜索树中的搜索.md
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ impl Solution {
}
```
### C#
```C#
```csharp
// 递归
public TreeNode SearchBST(TreeNode root, int val)
{
Expand Down
2 changes: 1 addition & 1 deletion problems/0707.设计链表.md
Original file line number Diff line number Diff line change
Expand Up @@ -1486,7 +1486,7 @@ impl MyLinkedList {
```

### C#
```C#
```csharp
class ListNode
{
public int val;
Expand Down
2 changes: 1 addition & 1 deletion problems/0746.使用最小花费爬楼梯.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ object Solution {

### C#

```c#
```csharp
public class Solution
{
public int MinCostClimbingStairs(int[] cost)
Expand Down
Loading

0 comments on commit 709b5ba

Please sign in to comment.