Count Inversions in an Array | Brute and Optimal

preview_player
Показать описание


Find DSA, LLD, OOPs, Core Subjects, 1000+ Premium Questions company wise, Aptitude, SQL, AI doubt support and many other features that will help you to stay focussed inside one platform under one affordable subscription. Have a hassle free one stop solution for up-skilling and preparing.

Checkout the problem link 👇🏼
Count Inversions in an Array | Brute and Optimal

Рекомендации по теме
Комментарии
Автор

Hi, hope you are well.


Find DSA, LLD, OOPs, Core Subjects, 1000+ Premium Questions company wise, Aptitude, SQL and many other time saving features under one affordable subscription. Have a hassle free one stop solution for up-skilling and preparing yourself.


takeUforward
Автор

Making the complex problem looks simpler is a kind of skill that striver only has🛐

attackgaming
Автор

Best count inversion video on YouTube, your method of teaching is very best that it gets me understand very easily 🌟🌟🌟

anuplohar
Автор

this is the best playlist in world. thank you stiver for your effort.

_AASHISHSHAH
Автор

I'm trying this problem and solved it by myself by taking count as global variable.. But you taught us in a vary optimal way without taking count as a global variable. Really best optimal approach. Thankyou ❤

Manishgupta
Автор

Timestamps:

00:40 Problem Statement
02:11 Brute force approach
02:52 Pseudocode
03:35 Complexity
04:05 Optimmal solution
04:22 Intuition
10:33 Approach + Dry-run
18:02 Code
22:37 Complexity

mehul_thuletiya
Автор

Completed the playlist. This was the best recursion playlist I ever went through. Thanks a lot Striver.

bmishra
Автор

The way you explain things step by step makes everything so clear. I don’t just follow the code, I actually understand it. That builds my confidence and makes me believe, yes, I can do this myself.

tanusharma
Автор

Nowadaya strivers voice has become so calm and soft 😅❤

satvrii
Автор

The best count inversion video on Youtube.. Thanks a lot Raj.. stay blessed❤

SuvradipDasPhotographyOfficial
Автор

Finally completed this recursion playlist and Thanks a lot striver for great explanation throughout and patiently drawing recursion tree. patience is the key to solve and teach anything . And you have it man and you are teaching that too. Thanks a lot again

gajendrakumar
Автор

Striver your voice is very soothing and calm bro ❤.... I use it to sleep at night AND study... and I don't feel sleepy

senseiAree
Автор

00:06 Count the number of pairs in an array where the left element is greater than the right element.
02:12 Brute Force solution
04:10 Counting the number of pairs in two sorted arrays where the left element is from the left array and the right element is from the right array, and the right element is smaller than the left element.
06:11 Inversion count can be found by counting the number of elements greater than the element on its right in a sorted array
08:28 The number of pairs formed in an array can be determined using the merge sort algorithm.
10:41 Counting inversions in an array by merging sorted subarrays.
13:03 Count the inversions in an array using a merge sort algorithm
15:17 Merge sort algorithm helps in counting inversions in an array
17:25 Count the number of inversions in an array
19:15 Count the number of inversions in an array
21:08 The solution uses a recursive function to merge and count inversions in an array.
22:51 The time complexity of counting inversions is O(n log n) and it requires extra space to merge arrays.

aradhyaagrawal
Автор

Understood! Super amazing explanation as always, thank you very very very much for your effort!!

cinime
Автор

I usually don't comment but wanted to say that just subbed your channel. This is the best explanation I've ever got. THANKS A LOT:>)

MehtabReviews
Автор

I was struggling with the solution but as soon as you mentioned merge sort it clicked in my mind

vaibhav
Автор

Note (not mentioned in the video): if equal, must move left pointer, not the right.
in actual merge sort, it doesn't matter which one we move
but for this problem, it only works if we move left pointer
Please correct me if I'm wrong.

jeevanprakash
Автор

Understood
THE BEST EXPLANATION
Excellent playlist 👌 👏 ❤

InduAnuga
Автор

As usual your teaching jus made coding much easier than it is bruh!! Waiting for Binary Search series bruh!!!!

selvaarumugam
Автор

vera level .
he nailed it . he makes it simple.
mind blowing

rajesh
welcome to shbcf.ru