diff --git a/leetcode/README.md b/leetcode/README.md index bffa4aa3..08e6a096 100644 --- a/leetcode/README.md +++ b/leetcode/README.md @@ -8,6 +8,7 @@ LeetCode |---| ----- | -------- | ---------- | |1|[Two Sum](https://https://leetcode.com/problems/two-sum/) | [C](./src/1.c)|Easy |3|[Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [C](./src/3.c)|Medium| +|4|[Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [C](./src/4.c)|Hard| |20|[Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) | [C](./src/20.c)|Easy| |24|[Swap Nodes in Pairs](https://leetcode.com/problems/swap-nodes-in-pairs/) | [C](./src/24.c)|Medium| |26|[Remove Duplicates from Sorted Array](https://leetcode.com/problems/remove-duplicates-from-sorted-array/) | [C](./src/26.c)|Easy| diff --git a/leetcode/src/4.c b/leetcode/src/4.c new file mode 100644 index 00000000..b5a2e830 --- /dev/null +++ b/leetcode/src/4.c @@ -0,0 +1,40 @@ + + +double findMedianSortedArrays(int* nums1, int nums1Size, int* nums2, int nums2Size){ + int index1=0; + int index2=0; + int v[nums1Size+nums2Size]; + int v_index=0; + + while(index1