1. Failed sort list requirement 2. An exception would fire is the list only has 1 item.
@ZeKermetКүн бұрын
Step 0: why do you need 10 billion elements?
@confidential303Сағат бұрын
In case you want to add 10 billion + 10 billion. You then can do a trick sum = large_number[-1] + large_number[-1]
@HaddedamКүн бұрын
If your task is find largest without sorting or some other ultra specific once in a lifetime use case, you could also find max, remove max from list and find max again. Or if no preprogrammed whatever you call those things is allowed, then instead of iterating through the list for one max value, you have max and previous max.
@black_crestКүн бұрын
Shouldn't an integer only take up 32 bits or 4 bytes on a 64 bit system? Why 28 bytes?
@kareems5126Күн бұрын
Just build a backend at this point with the data
@andreaselfving27872 күн бұрын
How can you now know how aliasing works if you've actually used python for more than textbook examples?
@TheCodeGriffin2 күн бұрын
I'd rather have O(1) indexing than O(1) insertion. Linked lists have an O(n) time complexity for selection, which is less desirable in most cases.
@mrtoine59022 күн бұрын
who tf runs this channel, it consistently posts literally the worst python content out there
@infinity_69762 күн бұрын
print(max(numbers.remove(max(numbers))))
@wong_tai_ming2 күн бұрын
Can easily be solved with two pointers
@infiteri60302 күн бұрын
Wont that be O(2n)? Assuming we beed the employee list back as an array, making a deque shoukd be O(n) and making a list from it should also be O(n). Btw i might be wrong, just asking
@dk4kja82 күн бұрын
"objects take up space in memory" So do integers 💀
@kizza93212 күн бұрын
They take up much more space than plain integers.
@dk4kja82 күн бұрын
@@kizza9321 i know
@dk4kja82 күн бұрын
@@kizza9321 not rlly actually only 1 byte
@averagesoul82562 күн бұрын
def f(a,b): return a+b print = f this is actually replacing print
@rniggardson2 күн бұрын
Only losers don’t know this. 😂
@kavuruvamsikrishna023 күн бұрын
awesome, nice
@talk94154 күн бұрын
Are you a clown? This is painful to watch.. I lasted 9 seconds... First import a new collection, then create a new structure, copy all elements there... Dude programming isn't your thing
@faisalmehmood53754 күн бұрын
You literally sorted the list tho. So you failed your own question.
@shalevforfor55504 күн бұрын
thats a mistake rhat some people does without even knowing they did it because it has a very little error
@robbyoconnor4 күн бұрын
Don't use eval() without guardrails It's not hard to do this without eval()
@easobral4 күн бұрын
now you are using more memory and average access time to a random element has also increased. You must know how it would be used to say something is better or worse. If you insert only now and then, but access it way more frequently, then you have created a bottleneck. There is no free lunch.
@barmalini4 күн бұрын
use generator, silly
4 күн бұрын
In a way, this function IS indeed super useful: if you spot any piece of code using this function, you know immediately who to fire and report to the feds 😂
@linearnorth12334 күн бұрын
hashmap?
@devnarula67335 күн бұрын
"most programmers don't know this"... proceeds to show this
@SanjayS-xd5yw5 күн бұрын
I have seen lot of video about python. But in your channel you teach everything in-depth it really helpful us for clear understanding
@mesmeridze15 күн бұрын
Day by day I like lists less and less 😊
@averagesoul82565 күн бұрын
this intern should be fired
@EslamEmam-gi5vk6 күн бұрын
pop max then max ?
@tamirshalev90196 күн бұрын
This is not true for nested dictionaries, I believe its important to mention
@okielama7 күн бұрын
This is so stupid
@trevor39058 күн бұрын
For this problem specifically, would you be able to reverse the list, append, and reverse again? What is time complexity of that?
@hariharan33817 күн бұрын
😂 2 times O(n)
@triip3338 күн бұрын
manual says: Deques are a generalization of stacks and queues (the name is pronounced “deck” and is short for “double-ended queue”).
@Havoc101409 күн бұрын
"Hey can you sort my data but only a little bit?"
@konstantinvyacheslavovich82179 күн бұрын
How about joblib is it same ?
@alishbamujtaba19959 күн бұрын
Why are there small bubbles 🫧 ig, or little bugs running around your screen?
@Nishwantsboobs9 күн бұрын
Dictionary is in imutable datatype
@zuja19 күн бұрын
Wtf is this shit?
@ArmirMitrandir9 күн бұрын
if you need speed and efficiency, just use sth else
@Manojkumar__9 күн бұрын
who the hell is using variable name as Exception ??
@onehmong936810 күн бұрын
Negative
@Sreekumarvpl10 күн бұрын
This is not useful.
@Sreekumarvpl10 күн бұрын
You are unnecessarily creating a dictionary here. We can achieve it directly using a for loop by appending to a list and ignoring the already added entry. Or by using list comprehension checking the index with the original list.
@Sreekumarvpl10 күн бұрын
Dont suggest this kind of things in your video. As per official python documentation: """ Warning: This function executes arbitrary code. Calling it with user-supplied input may lead to security vulnerabilities. """
@yehorishtvan380210 күн бұрын
Nice man, deque - i dont use for python, only for c++. Its interesting o(n) and o(1)
@shyamgurunath587610 күн бұрын
Two pointer would solve these in o(logn)
@averagesoul825610 күн бұрын
no intern will ever be tasked with something like this. theyll make a div red from blue at best
@hariram802210 күн бұрын
Hey hi everyone I am that new intern he's been talking about in every video .he ows me credits for that🙂↔️