Index of an Extra Element | Problem of the day | GeeksForGeeks

  Рет қаралды 37

Mathematics

Mathematics

Күн бұрын

You have given two sorted arrays arr1[] & arr2[] of distinct elements. The first array has one element extra added in between. Return the index of the extra element.
Note: 0-based indexing is followed.
Examples
Input: n = 7, arr1[] = {2,4,6,8,9,10,12}, arr2[] = {2,4,6,8,10,12}
Output: 4
Explanation: In the first array, 9 is extra added and it's index is 4.
Input: n = 6, arr1[] = {3,5,7,8,11,13}, arr2[] = {3,5,7,11,13}
Output: 3
Explanation: In the first array, 8 is extra and it's index is 3.
Expected Time Complexity: O(log n).
Expected Auxiliary Space: O(1).
Table of Contents
0:00 Problem Statement
0:42 Solution
4:40 Pseudo Code
6:25 Code - C++
7:25 Code - Python

Пікірлер: 3
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 55 МЛН
That's how money comes into our family
00:14
Mamasoboliha
Рет қаралды 10 МЛН
Using read write locks (example in C)
17:11
Jacob Sorber
Рет қаралды 3 М.
Programming with Math | The Lambda Calculus
21:48
Eyesomorphic
Рет қаралды 141 М.
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
31 nooby C++ habits you need to ditch
16:18
mCoding
Рет қаралды 741 М.
Toeplitz matrix | Problem of the Day | GeeksForGeeks
15:01
Mathematics
Рет қаралды 53
The Most Important Algorithm in Machine Learning
40:08
Artem Kirsanov
Рет қаралды 323 М.
every good programmer should know how to code this data structure (its easy)
21:08
Use Arc Instead of Vec
15:21
Logan Smith
Рет қаралды 138 М.
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 55 МЛН