---
title: "Discussion on \"4. Median of Two Sorted Arrays\" | Hashnode"
description: "Discussion on \"4. Median of Two Sorted Arrays\". Problem Statement\nGiven two sorted arrays nums1 and nums2 of size m and n respectively, return the median of the two sorted arrays.\nThe overall run time complexity should be O(log (m+n)). (link)\nExample 1:\nInput: nums1 = [1,3], nums2 = [2]\nOutput: 2...."
url: "https://hashnode.com/posts/4/65a655e2dae659d1ea8c8123"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [4\. Median of Two Sorted Arrays](https://chetan77.hashnode.dev/4?utm_source=hashnode&utm_medium=feed)

Problem Statement 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)). (link) Example 1: Input: nums1 = \[1,3\], nums2 = \[2\] Output: 2....

Jan 16, 2024 · 6 min read · chetan77.hashnode.dev  
Updated May 12, 2024  
Read the article

-   [#median-of-two-sorted-arrays](https://hashnode.com/tag/median-of-two-sorted-arrays)
-   [#striversa2zdsa](https://hashnode.com/tag/striversa2zdsa)
-   [#binary-search](https://hashnode.com/tag/binary-search)
-   [#leetcode](https://hashnode.com/tag/leetcode)
-   [#java](https://hashnode.com/tag/java)
-   [#software-engineering](https://hashnode.com/tag/software-engineering)

## Written by

[Chetan Datta](https://hashnode.com/@chetan77)

@chetan77 · Hyderabad, India

  
[View profile](https://hashnode.com/@chetan77)

Software Engineer

I share my learnings here. Thanks for reading.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
