You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 66.PlusOne.cs
+38-1Lines changed: 38 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,44 @@
1
1
// 66. Plus One
2
-
// You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's.
2
+
// You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer.
3
+
// The digits are ordered from most significant to least significant in left-to-right order.
4
+
// The large integer does not contain any leading 0's.
3
5
// Increment the large integer by one and return the resulting array of digits.
4
6
7
+
// Example 1:
8
+
// Input: digits = [1,2,3]
9
+
// Output: [1,2,4]
10
+
// Explanation: The array represents the integer 123.
11
+
// Incrementing by one gives 123 + 1 = 124.
12
+
// Thus, the result should be [1,2,4].
13
+
// Example 2:
14
+
// Input: digits = [4,3,2,1]
15
+
// Output: [4,3,2,2]
16
+
// Explanation: The array represents the integer 4321.
17
+
// Incrementing by one gives 4321 + 1 = 4322.
18
+
// Thus, the result should be [4,3,2,2].
19
+
// Example 3:
20
+
// Input: digits = [9]
21
+
// Output: [1,0]
22
+
// Explanation: The array represents the integer 9.
Copy file name to clipboardExpand all lines: 79.Exist.cs
+2-7Lines changed: 2 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,13 @@
2
2
3
3
// Given an m x n grid of characters board and a string word, return true if word exists in the grid.
4
4
5
-
// The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or vertically neighboring. The same letter cell may not be used more than once.
6
-
7
-
5
+
// The word can be constructed from letters of sequentially adjacent cells, where adjacent cells are horizontally or
6
+
// vertically neighboring. The same letter cell may not be used more than once.
8
7
9
8
// Example 1:
10
-
11
-
12
9
// Input: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "ABCCED"
13
10
// Output: true
14
11
// Example 2:
15
-
16
-
17
12
// Input: board = [["A","B","C","E"],["S","F","C","S"],["A","D","E","E"]], word = "SEE"
Copy file name to clipboardExpand all lines: 84.LargestRectangleArea.cs
+2-1Lines changed: 2 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,6 @@
1
1
// 84. Largest Rectangle in Histogram
2
-
// Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram.
2
+
// Given an array of integers heights representing the histogram's bar height where the width of each bar is 1,
3
+
// return the area of the largest rectangle in the histogram.
Copy file name to clipboardExpand all lines: 88.Merge.cs
+43-2Lines changed: 43 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
// 88. Merge Sorted Array
2
-
// You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, representing the number of elements in nums1 and nums2 respectively.
2
+
// You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n,
3
+
// representing the number of elements in nums1 and nums2 respectively.
3
4
// Merge nums1 and nums2 into a single array sorted in non-decreasing order.
4
5
// The final sorted array should not be returned by the function, but instead be stored inside the array nums1. To accommodate this, nums1 has a length of m + n, where the first m elements denote the elements that should be merged, and the last n elements are set to 0 and should be ignored. nums2 has a length of n.
5
6
7
+
//Time O(nlogn)
6
8
publicclassSolution
7
9
{
8
10
publicvoidMerge(int[]nums1,intm,int[]nums2,intn)
@@ -13,4 +15,43 @@ public void Merge(int[] nums1, int m, int[] nums2, int n)
0 commit comments