Back to Browse

Segment Trees Series | Part 3 | Solving Codeforces problem "Enemy is Weak"

3.1K views
Apr 12, 2023
26:13

Part 1 - https://youtu.be/U5cedpBSSHg Part 2 - https://youtu.be/tcsPJFKoNNY Segment Trees Problems Playlist - https://www.youtube.com/playlist?list=PL9TOCZErLZcN4eFIBvFNJ3SirAeMFzTfz ************************************************* Problem discussed - https://codeforces.com/contest/61/problem/E Solution - https://codeforces.com/contest/61/submission/201124132 Next Problem - https://codeforces.com/contest/459/problem/D Complete Practice Sheet - https://bit.ly/segment-trees ************************************************* Timestamps 00:00 - Introduction 01:35 - Recap - Finding # of smaller elements in left 05:23 - Understanding Problem Statement of "Enemy is Weak" 07:19 - Brute force - O(N^3) 08:11 - Optimizing from O(N^3) to O(N^2) 10:57 - Which of "i" or "j" will you remove and why? 12:55 - Optimizing from O(N*N) to O(N*logN) 15:00 - Dry run of the algorithm 16:02 - Recap of the solution 18:05 - Code Walkthrough 22:30 - Deriving 2nd array from 1st array or vice-versa 24:50 - Follow up - When elements are not distinct :) 05:10 ************************************************* Interview Experiences Playlists - Microsoft - https://www.youtube.com/playlist?list=PL9TOCZErLZcOsCBZPQ3uIMzak6gQWG_Kp Amazon - https://youtube.com/playlist?list=PL9TOCZErLZcMFSmxoEpNBxvQfWOgRmsfX D.E.Shaw - https://youtube.com/playlist?list=PL9TOCZErLZcM8nwVeW4d7JyxcpH175IZ1 Linkedin - https://www.youtube.com/playlist?list=PL9TOCZErLZcMN56ITB1IkNUs10QnaEyAe Facebook - https://youtube.com/playlist?list=PL9TOCZErLZcNIcaPV8WeHdXHPgAstBf2E ********************************************************************* Please show support and subscribe if you find the content useful.

Download

0 formats

No download links available.

Segment Trees Series | Part 3 | Solving Codeforces problem "Enemy is Weak" | NatokHD