Given 2 sorted arrays Ar1 and Ar2 of size N each. Merge the given arrays and find the sum of the two middle elements of the merged array.

Input:
N = 5
Ar1[] = {1, 2, 4, 6, 10}
Ar2[] = {4, 5, 6, 9, 12}
Output: 11
Explanation: The merged array looks like
{1,2,4,4,5,6,6,9,10,12}. Sum of middle
elements is 11 (5 + 6).

--

--

--

iOS Developer, Triple graduated, Passionate, Love workout, blogger

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

New or Unique Formats for Serving Web Images and When to Use Them

The Beauty of Python — Part 2

How to install MariaDB on Ubuntu 20.04

10 free stock photos you would actually use (Sunday 15th 08AM edition)

Bike-shedding, The Waterfall Industrial Complex, and the Force of Nature That is Sinking Your…

Resources on open-everything and sustainable model

The Black Box Analogy: Theoretical Explanation

How to Resize a PDF File in PHP

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mr.Javed Multani

Mr.Javed Multani

iOS Developer, Triple graduated, Passionate, Love workout, blogger

More from Medium

How I programmed an Australian Digital ID allowing minors to enter pubs.

What are API’s? How do I use them?

Server Response Cycle

My Journey from getting selected as CodeChef Chapter Leader to Organizing the first-ever Induction…

Need for different sorting algorithms