Skip to content

Commit da2bc79

Browse files
Update README.md
1 parent a76d756 commit da2bc79

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,11 @@ function lengthOfLongestSubstring(s: string): number {
6060
</details><!--module 3 code ends-->
6161
</details><!--module 3 ends-->
6262

63-
6463
<details>
6564
<summary> <strong>4. Median of Two Sorted Arrays</strong> </summary>
66-
67-
Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.
68-
69-
The overall run time complexity should be O(log (m+n)).
70-
65+
66+
Given two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).
67+
7168
```typescript
7269
Example 1:
7370
Input: nums1 = [1,3], nums2 = [2]
@@ -88,10 +85,12 @@ nums2.length == n
8885
1 <= m + n <= 2000
8986
-106 <= nums1[i], nums2[i] <= 106
9087
```
88+
<!--module 3 code-->
9189
<details>
9290
<summary><strong>See solution</strong></summary>
91+
9392
```typescript
94-
function findMedianSortedArrays(nums1:number[], nums2:number[]):number {
93+
function findMedianSortedArrays(nums1:number[], nums2:number[]):number {
9594
const totalLength:number = nums1.length + nums2.length;
9695
const isEven:boolean = totalLength % 2 === 0;
9796
const medianIndex:number = Math.floor(totalLength / 2);
@@ -115,12 +114,14 @@ nums2.length == n
115114

116115
return isEven ? (prev + current) / 2 : current;
117116
}
118-
```
119-
</details>
120-
121-
</details>
122117

118+
```
123119

120+
</details><!--module 3 code ends-->
121+
</details><!--module 3 ends-->
122+
123+
124+
124125
<details>
125126
<summary><strong>5. Longest Palindromic Substring</strong> </summary>
126127
30-31.03.2023:

0 commit comments

Comments
 (0)