Daily Dose of LeetCode: Kth Largest Element in a Stream
Вставка
- Опубліковано 9 чер 2024
- Hello everyone, this is YOUR Daily Dose of LeetCode
In this video, we're tackling the Kth Largest Element in a Stream problem. We'll not only discuss the key insights but also explore the optimal possible runtime, and dive into both brute force and optimized solutions.
Remember to like, comment, and subscribe to stay updated with our LeetCode problem-solving guides, and drop a comment if you have any other problems you'd like me to solve.
// TIMESTAMPS //
00:00 - Intro
00:15 - The problem in simple terms
00:39 - What are the key takeways?
01:10 - Brute Force Solution
02:30 - Optimized Solution
// SOCIALS //
Twitter: / thecodingsloth1
TikTok: / thecodingsloth
#leetcode #python #codinginterview #algorithm #programming #codingtutorials #computerscience
2:16 complexity of constructor is O(1) - it doesn't matter how many elements we just save them without any iteration
Your content is sooo underrated.
Genius
in python:
return sorted(nums)[-k]
I've an interview tomorrow...and can't come up with that optimised approach🫥