To minimize the sum of an array by repeatedly replacing elements with their smallest available divisor, use a hash set to store all numbers in the array. For each element, find its smallest divisor by checking from 1 up to the square root of the element. If a divisor exists in the hash set, replace the element with that divisor; otherwise, keep the element as is. This approach ensures the minimum possible sum by always replacing each number with its smallest available divisor.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Officially graduated college | Leetcode Weekly Contest 501 | Live AttemptAdded:
Hello, bro. Hello.
The contest is about start.
Hello, bro. Hello. Good morning.
Good morning.
Contest is about to start.
Good luck, bro. 4x4 or gay? Are you stupid?
Kamali, bro. 4x4, man. Shut up.
I was just thinking that what what if I just do the first two questions and end the stream and go back to sleep.
That would be so good, bro.
What time did you all sleep last night?
Okay, good luck, bro. Good luck.
Bro, what?
I'm so sleepy.
1 2 3 3 2 1 Come on.
Okay. Okay. Okay.
You're given an RF string chunks. The strings are concatenated in order to forming the string s.
You're also given an string query. The word is defined as a substring of s as that consist of may include hyphens only. Each hyphen is surrounded by and is not part of a longer substring that also any character what are the constraints here 10 to 5 any character that is not a lowerase English or valid hyphen acts as a separator.
Okay, return include hyphen is the number of occurrences of queries I as a word.
Hello world.
Hello. Okay. The the valid words uh is queries is how much time?
Hello world. Hello. Hello comes two.
World comes once. World comes once.
Okay.
What is this stupid ass?
You may include hyphenia. beach hyphen is surrounded by and is no longer a part.
What a stupid.
The valid words in S are A which appears twice, B which appears once and C which appears once.
Chunks may consist of spaces and hyphens. The total length of all the strings in chunk does not exceed Wait, I didn't get it, bro. What is this [ __ ] These strings your word is defined as a substring of SS that consist of Okay.
lowerase English characters may include hyphens only if each hyphen is surrounded by lowerase English letters.
Oops. Hello world.
Am I second question? I'm [ __ ] again.
Then include is no longer part of a substring that also satisfies the above condition.
So spaces start a new word.
A by define B.
Okay. No A. A minus - B. Then there's base - C.
What are I need to run a few test cases?
What even is this? Like the description is so cool.
Whoa. What?
Oh my god.
You don't even have expected output available. Oh, you don't have expected output available. Wow.
What is the use of hyphens?
uh word is defined as a string of such that include hyphen each hyphen is surrounded by lowerase English letters.
Hyphen is surrounded by lowerase English letters.
What does that mean? Is not bro. I'm going to get I'm going to lose rating in this one because they haven't like the description is so bad.
You're given an integer. You can perform the following operations any number of times. Choose to indices such that replace return after performing minimum possible sum of the array.
What?
Such that uh one index is divisible by other. Replace nums A with nums B.
Return the minimum possible sum of the array. 362.
Replace nums. Oh, okay.
Okay. Okay.
What question do I even focus on at this point? The second question is so stupid.
What What's the use of hyphens here?
Any character that is not a lowerase English letter or a valid hyphen acts as a separator.
Okay. So any minus minus Oh, okay. Okay. I understood now. I understood now. Okay.
Okay. This The uh chunks.length the total length of all strings does not exceed 10 to 5 string as of your chunks.
Okay. Okay. Uh now for end I = 0 I less than S dot length A+.
And what does S consist of? Spaces and hyphens.
Spring word.
Only if each hyphen is surrounded by lower may include hyphens. The hyphen might be just a single word. Okay.
If s equals to is if if s i equals to if that is equals to space not s concat i equals equals to space then you can say uh okay fair fair bro unordered Uh then we can just say hash of word plus+ and word becomes your empty string.
Okay, because space is a separator.
Okay. Now if it is hyphen if concat I equals equals to hyphen and if that is hyphen we see valid or not.
Valid means left and right are cars.
I -1 is greater than equal to 0 and and and uh we can say concat of i minus one is not equals to is not equals to um is not equals to space and concat I - 1 is not equals to hyphen and i + 1 is less than i + 1 is less than let's just say n + one is less than. Oh [ __ ] what a what a stupid question. concat length and and concat I + 1. Oh my, that is blur, right? Yep. Concat of I + 1 is not equals to space and then concat of I concat of I + 1 is not equals to hyphen then it is valid then it is valid then just word plus equals to your your SI I notice concat I right. Else else there is not a separator.
Else hash of word plus plus and your word becomes empty. This is a separator.
Write else word plus equals to concat I write write Indian just hash of hash of word ++ let me make sure bro my brackets brackets are correct yep now for for string s of queries.
If uh hash dot find s is not equals to hash dot end answer push back hash of s else answer dot push back zero What the [ __ ] bro? It didn't had a single word.
Yo, see how we concat, bro. See out concat.
Why is Why is it not see out in Okay.
Okay. Okay.
Hello world. Hello. Fair A standard yo 211.
But that is incorrect. Why is it this is hello and l the valid word in S is hello.
chunks is hello fair. Here the chunks is s equals to that that is just yep s r which appears twice b.
Now what's happening here is after concatenation uh space is a separator. Space is a separator, right?
If valid then we are adding that else invalid hy that's an invalid hyphen invalid hyphen fair invalid hyphen bro this should have worked oh my god what is this question what is this question.
What is this question? This should have worked.
So, A B A appears twice.
First of all, how's the last word, right?
AB A C. Okay, it's giving a space.
Oh, okay. So, it's adding a space before it.
What it's doing is a -.
So, if it is hyphen, it is invalid. It is skipped.
If it is hyphen, it is invalid. Then hash of word word equals to this. Now, next time also it is a hyphen.
hash of word++. What is this?
Why? Okay, bro. The second question has cooked me already.
Hold on. It's working now.
And for my fourth case, it is a B minus A. Why is there a B minus A here?
What?
Yo.
Bro, this question is so stupid.
All third just now. Almost done with second.
Just g. Yeah, exact. Bro, but I know this is not like this is stupid.
This is See, I think here one of the valid string is a then it's giving empty strings then b and and the previous one is not space.
Previous one is and end.
Okay, I think I might need to rewrite my valid definition.
Okay, I need to rewrite my valid definition.
Valid hyphen. It's going to take in string concat int i if i greater than zero and then uh concat i -1 equals = to minus or Concat I - one= equals to space we return false.
Okay. Now if I + 1 is less than concat dot length.
Okay. and and and concat I + 1 = = to iPhone. Bro, questions like these always I hate question like these.
equals to write return false return true.
If valid if valid hyphen or concat comma I string and concat.
If that is valid, else why my logic Hello world. Hello. Fair fair.
Now in this case it starts with a it becomes a minus b and then why is the second hyphen added bro?
Should I give up on life firstly? How?
Secondly, why could I solve third first and second?
Bro Jason bro you're asking me to solve third first replace the minimum possible sum of the area after performing any operations is going till 10 to 5.
What a stupid question this is.
Oh my bro, let me just you know what? Choose any indices A and B such that what is the logic here smallest number?
What are what is the length of your numbers? Nam Z is still 10 to 5.
Um Z is still 10 to 5. Do we go like using prime such that replace nams with nums we return the minimum possible sum.
So we want to find the smallest divisor that exists in the array for every element.
Then the minimum possible sum.
No further operation reduces the sum.
Three two. We want to find it at the end of the day. Okay, it's not always going to be prime. What if you have four and eight?
4 8 12. So, it's going to be 4 44. Huh?
It's not going to be prime for 10 to 5. We can't do it in n².
I can't solve this either.
1059. There's no pair.
Can't run in square here.
If it is prime, we simply add it in. Do we need will we need to check for primes in there?
What if we just sort it, bro? We sorted Man, this question, bro. I'm I'm I need to solve this one first. Bro, this question is irritated the hell out of me.
This question. So the point is first of all let me write if uh word dot empty if word is not empty then only do hash of word right this condition goes everywhere.
This condition goes everywhere.
Yep. First, this is going to help clean out the output and see out world.
No see out word.
This is the condition we need to write what even how do we even do the third question I'm cooked in today's contest but so a is one word a minus see that's the why is it now what's happening is second one is hyphen, right?
And it is invalid hyphen see out valid hyphen at valid hyphen at i.
Now let's see if if my valid function is somehow returning incorrect valid hyphen at one. How the [ __ ] is that valid?
Stupid.
If I is greater than zero and then concat I - 1= 1 or concat I minus one.
Oh, a b minus a c a b. Okay, now it's 21 2 1 1 0 and it's going even 311.
Okay, now I think this might be correct.
Now I think this might be correct. What if in here we wrote kind of like this?
What are the words then?
Then it's a b minus a c a b. Okay. And another a.
Fair, bro. Now it's working. Correct. We just need to edit all the see outs.
Edit all the see outs and submit, bro.
Edit the see outs and submit.
Submit this. See out concatenated.
It's working.
to 1 0 2 1 1 2 1 zero to one 1 and then we have 1 zero.
Okay, fair, bro. This is going to work now. Please, I spent way too much time on this for this to not 14 test cases. 14 test cases.
What chunks?
What?
Now where's the issue?
Correct. Line 1263.
Bro, what?
What the I I'm indexing things wrong.
I'm indexing thing wrongs. How's that possible? How did I get a This is This is basically going out of bounds, right, bro? Are we serious?
concat plus equals to string s of chunks i less than concat.length.
Bro, what?
What the heck?
Bro, so for i less than concat.length concat I.
So for zero i is greater than zero. Okay, it's failing for i = to 1.
I is bro I'm cooked in today's concat of I and L.
So concat of is minus and for hyphen it's going to go in here.
Wait, what have I done here?
What is this? Is the if condition if it is valid then invalid is not empty.
Okay.
See your word end word. What becomes invalid hyphen?
And what is not empty? What if i + 1 is less than concat.length?
Bro, what? What a stupid typo. What a stupid typo, bro. What a typo, bro. Why am I doing these typos? I wrote plus instead of minus, bro.
And I'm going to get a minus 30 today.
A minus goddamn 30.
[ __ ] me, bro. I'm so frustrated right now. I'm so frustrated.
See, the point is I'm going to get another error. I'm 100% sure. 211 2110.
Please, please, please, please.
Oh my god. Oh my god, bro. Oh my god.
minus le.
Oh my god, bro.
If I = to zero or I = to concat.length.
What a stupid condition.
I + 1 then it is invalid. Go. Turn false.
1 0 1 1 0 1 0 0 1 0 1 1 0 1 0 0.
So my matches right now.
Everything else is same.
error. Low low.
Oh, bro. This is Bro, bro, this just the smallest man. What is Bro, it is. Don't we Bro, be cool. Just implement you tala bro.
Thank you bro. Thank you. Thank you bro.
Thank you. You given it. Now the third question. I don't have the logic for the third question bro. It's saying 3,000 people have solved it already.
Perform the following operations any number of times. Choose any two indices.
Return the Okay. So for every number we need to find its smallest divisor.
You know what we can do here? What if set of intr set of int hash for int uh vector of end right for int of your nums hash of l++ or no hash dot insert le now or le of your nums Write I ++ Now if le percentage i= to equal to0 and and uh hash dot find is not equals to hash dot end then we're going to answer plus equals to then we're going to do answer plus equals to i and Take found equals to true and break right. If is not found answer plus equals to le answer. Bro, what this logic the point is I might get a T in here, bro. But the first one is getting three hash. Hash.insert Certely.
Why am I getting three now? 4283.
See out found I or L.
Okay.
See how adding raw.
Okay. Now see, but why why can I never get my code right in the first attempt?
Found one for four.
How? And an hash.find is not equals to hash.
Bro, it's not even in the hash. What are you talking about?
Hashf find I I stupid I 7 9 21. Bro, would this give a TLE? That's the worst part.
Would this give a TLE? Please God, please don't give me a T. And they can repeat.
Let me just unordered map.
P of L equals to= to I of L= to L.
Right.
If priv is not equals to priv end then answer plus equals to p of le and continue.
I just did a quick hashing 21 97.
I just did a quick hashing. That's it.
362 of L equals to I pro of L equals to L.
Yeah, I just did quick hashing. Please, please, please, please, please me. Wrong answer.
Bro, wrong answer. How How did I get wrong answer? It's not even a T.
Bro, it's 24 2412.
Is it's wrong because of my previous Oh my god, bro. Why do I ruin every Sunday of mine? Yesterday was such a good day, bro. 112 for 24 adding raw for 12 of equals to I.
And guess what? Now we going to get a a TLE. Now we Bro, wait. I can't focus today. I wrote double equals to instead of single equal to, bro.
What is wrong with me today, bro?
And now we get a TLE. Yep. Yep. Throw it. Throw it. Thank you, [ __ ] Throw it.
This guy doesn't listen to his chat, bro. It's live contest. I cannot I I Bro, told him in the first three minutes, bro.
Oh my god.
So I'm going from one to half, bro. Hold on.
You can go till is that correct? 21 60 Hold on.
Hold on.
Hold on.
Hold on. Fair, bro. Fair. Fair. Fair.
Fair. Fair.
60.
24. 24. 12.
7 9 21.
2412. How's that 60? Wait now. How is 24 20? What the [ __ ] How is that 60?
How is that 60?
I'll crash out, bro. I I'll genuinely crash out at this point.
Give me my old code. Give me my old code.
Give me my old code here. Okay.
No.
Rather than doing this you go for i = to 1 i less than equals to limit + h if how does it okay I need to calm down bro I need to come down. It is going 24.
If le percentage I equals equal to zero and hasht find I is not answer plus equals to I found equal to two and break.
It's adding 60. That is [ __ ] crazy.
Let me just see out everything.
adding old val uh priv of Ellie for for adding that for let's say just uh rally.
Now let's see where the [ __ ] is happening.
What's the issue?
7 9 21 adding 24. Adding old val 24 for 24.
Wait, we can't do that.
We can't do that.
Oh my god.
Wait, hold on. Uh, hold on. So what we doing here is it's giving us a TLE because I'm going till okay I'm going till half I'm going till half even after square roots there can be okay bro third one is getting slow for me too exactly 1 and three penalty second key bro square root me bro I'm not using that logic square root me you Go you go for primes, right?
Uh square root.
Where can I optimize this is? I can right now.
Set stores in order element, right? Set set stores in sorted order in CP. It does, right? Yes.
For index of my set.
Okay.
Okay. Okay, rather than running this here, what we can do is for int and le of of our air if le star 2 is greater than is greater than your your not for in temp 2 is greater than your then we break.
If le percentage m is equal to equals to zero, then what we can do is we can uh answer plus equals to p of del equals to temp answer plus equals to temp and found equals to true and break.
That is it.
found temp for this. Now let's see this.
Hopes this works. Int and temp.
How how do you iterate? How do you iterate, bro?
How to iterate over I forget this every time.
Also auto and element hash is our set.
Now it's giving 36.
We can't even check if this is still a T or not.
Can't even check if this is still a T.
367 921.
Please, please, please.
Wrong answer. Runtime error.
Bro, integer overflow cannot be represented.
Answer plus.
Oh, did we get an end overflow in 2026?
I did.
Why? Like why?
I'm tired of my life, bro. Just just let me live a peaceful life. Why did I even make a choice of doing elite code, bro?
Why? Like what?
I didn't even see it's asking for long long.
I didn't even see it's asking for long long. And guess what? We can still get a goddamn TLE. We can still get a goddamn TLE, bro.
We can still Oh my god, bro.
Oh, just kill me, bro. At this point, I don't want to live anymore.
The test case is goddamn hidden. I don't want to live anymore, bro.
I don't want to live anymore.
I don't want to live anymore. I don't want to limit exceeded.
Time limit.
I don't want to live anymore, bro. At this point, Hello, bro. Overslept. Looks like a good decision. Is fourth one doable?
Bro, I'm using a set. How the hell?
Right, I'm storing everything in a set.
Set stores in ordered manner. Right, I'm breaking out early.
Right, I'm breaking out early.
I'm breaking out early.
These [ __ ] have not shown us a test case.
Where can I even optimize this? Every element kill I see if that element cleared. If that is a repeating element, so I add the previous score. If not if not repeating then we go then we iterate over our set of elements smallest to biggest and anytime the temp star 2 is greater than element we break right we break the value temp and we break another found equals to true and if it is not found how can I [ __ ] optimize this further how the hell what is my rank 9,000 5,000 people have done 8,000. Oh my god, bro. I'm going to lose all the rating I gained yesterday. All the rating I'm going to lose today.
Going to lose all the rating. RT dice is such that where the [ __ ] does square root even comes in picture here, bro?
Hey, what what bro? Am I dumb?
Choose two dice A and B. return the minimum possible sum of we want to find divisor for every number that exists that exists.
How do you find divisor my dear friend?
Divisers exist up until square root of n.
Like for for 16 the square root is four but eight is a divisor.
Hold on.
Eight can be found using two. Eight can be found using two.
Hold on. So do we go till square root?
Do we go till square root?
I = to 1 square root of square root of your LE I ++ So we we finding so do we find devices Jesus.
If le percentage I equals equals to zero then let's just do vector in divisor divisor dot what am I doing divisor dot push back your URI okay Now see we're going till square root of n but we want to find the divisor.
Oh my god, bro. 29 minutes before I redeem myself, bro. 29 minutes before I redeem. I'm cooked.
Solve four questions as first year student. Mining Tam is a 1169.
Bro, I'm getting TL you see logic.
Se bro, that is the first thing I thought, bro. See, so we're going to check for primes.
Hold on. Hold on.
Hold on.
Hold on. So we we want to find divisor for every number, right? And see which divisor exist.
Steve's logic simply stated, "Bro, I'm a dumbass, bro. No joke. I I deserve to lose rating today."
Siege logic. Uh, it starts from it was used to find out crimes. Okay.
It was used to find out crimes.
Yep. It bro [ __ ] I'm a dumb ass, bro.
10 sh bro, it's not getting accepted for me. You're telling me brute force worked? Brute force worked, bro. It's not working for me. What the hell? I'm not even doing brute force. Just find devices. What the hell do you mean? What am I doing? Am I stupid? It's giving me TLE.
Just find devices. That's what I'm doing.
That's what I'm doing, bro.
For even 10 to 5 it's going to be 1,000 the square root of th00and 10,000 is square root 10,000 10,000 is 4 See what I know what ordered a set of And if uh le percentage I equals equals to zero then you can just say div dot div dot insert div do.insert insert I div dot insert le by I.
Okay. Now just see for constant auto and temp of your hash if of your uh div if div.
We don't need this now. We don't need this now. Found [ __ ] We don't need this.
If temp dot a No, no, no, no, no, no.
If you can just say uh that was hash right hash.
M is not equals to hash. end then you can say previous of LE equals to temp answer is equals to temp break let's see I don't know if this made it fast or not bro 36 7 921 Did it make it fast or no I don't know bro I don't Uh, this should work, bro. I think this should work.
Less than equals to square root I ++.
Ready for another TLE? Are we ready for another TLE? Let's go. I'm hungry. Let's eat some T, bro. Let's eat some T. I'm hungry. Should we go for it? Should we go for it? Absolutely. Give me T. Please give me dearly. Give me dearly.
It [ __ ] worked. It worked, bro.
It worked, bro.
It worked.
Bro, hell no, bros.
Hell no. Who the [ __ ] did 10 star five?
Who the hell wrote that, bro? Who the hell wrote that, bro?
Who the hell wrote 10? Oh my god, bro.
I'm [ __ ] in today's contest. What's my rank? What's my rank, bro? Even after solving how many? I got six penalties today.
Six penalties.
Oh, okay. It's 5k. It's 5k. What is the fourth question, bro? Minimum cost to buy apples. You're given a price in an integer where price is price is the price of apples. You're also given a 2D integer where it's a birectional road. You and I are the shops connected by the road. Cost uh is the cost to travel the road without carrying apples.
Is the multiplier applied?
Travel empty to any shop J using uh any number of roads by price is return to shop I while carrying them paying cost the forward path value and return path may be different return an integer answer of star N where answer I is the minimum starting from shop I.
Okay.
So, you can either buy it from there.
You can buy it from there.
Return.
We have roads.
Okay.
Minimum to total cost to buy apples from that shop.
Second question will ask since pass two contest bro today's second question was asked the yesterday was so good bro de size 1.6k 6K. Bro, stop flexing, bro.
Stop flexing. Stop flexing, brother.
Bro, what a strange. Got four penalties. I got two penalties on second, four on third. [ __ ] me, bro. Third was [ __ ] hard. Then second, man. Bro, it's just that, man. I don't even know what to say, bro. I hate my life. I hate my life.
Hi, Stranger Gaming. Saying hi, Scribble, bro. No, we are not playing any Scribble today. Did you see how did I perform in today's contest? Did you see? Second, easy bro just delimited logic, bro. It's the fact it's the fact that uh there were too many edge cases in second. Like questions like those shouldn't even exist. They shouldn't even exist, bro. Like what's the use of that question? Stupid ass question.
And my mood is ruined, bro. Do I just end stream and go to sleep? I'm not trying to do this question.
Roads.length. Yeah. [ __ ] no. I'm not doing this question. I'm already angry as hell.
Hi, bro. How many are there? How many?
What? Goku.
Hi, bro.
I did three. I did three. Salt four is first year. Mining Tama 1169. Brother, please stop flexing. We know you're great at DSA. Please stop flexing.
Please stop flexing. Please count. Such question should not exist.
Bro, but see any sane person would agree with me. Second question was asked.
Second question did not deserve to exist.
It's okay brother. Come back stronger happens. Thank you bro. Howdy. What's up bro? What's up contest? See Chris Bumps said finally somebody's agreeing with me. Somebody's agreeing with me, bro. Back to back.
Like yesterday's second question, it deserved a lot of thinking. There was some hidden logic. Was there any logic in second question today?
Was there any logic in second question today? Mining Tama. Yeah, bro. Give your ID. Mining thumb is up. Probably give your ID. I'm hurt this time.
Same. skip second or third. Fourth is Jigstars again, man. I should be revising the jigstra, bro. But I'm just so angry at this point. I I can't I can't, bro. The second and third question, they've made me so mad. I got a useless penalty because of int overflow. Int overflow in 2026. Can you believe that?
Int overflow. That should have been the first thing I see in a question that is it asking for long long or in I got an in overflow bro remember that remember that I've given 40 contests and I get an in overflow. How dumb a human has to be to get an in overflow yesterday positive today negative equal [ __ ] no bro I just cannot reach 1900s bro I just cannot reach 1900s sorry ID okay bro let's see let's see coder tamil one bro what what did I do undo undo undo why did yo Hanu Hanu gaming bro I mistakenly might have deleted your like uh your message bro please message again that was a typo coder Tamil Sale182 questions are we serious should we do a code lead on my brother let's hope you're clean chat chat this guy bro let me come this side. Let me remove the blood. Chad, we are seeing a large face. Bro, what do we think of this? Okay, maybe some other contest.
Bro, don't tell me this guy is a [ __ ] cheater. I I'll crash out right now.
I'll crash out right now. He was flexing in the stream. He was flexing in the stream. Let's hope this is minimum cost to move between indices. What is this question? Your rank is 2022.
I'm going to beat his ass if he's if he's a cheater. And he was [ __ ] plexing. He was goddamn flexing. Where Where is he, bro? Coder Tamil he does not even exist.
Coder Tamil S1 2022 is someone else that is Anishk.
He does not even exist bro. Okay maybe some other contest.
See there are paste in every question.
Maybe he's using external editor bro. We can't say for sure. Sorry bro if I'm accusing you before even you are guilty right valid elements 1769 1769 yeah bro we don't know yes look at what the hell storing midway as Yo, you come. Is Is he in the chat? Is he in the chat? Is he in the chat?
Where? What the hell was his name, bro?
What the hell was his name, bro? Chat, somebody tell me his name, bro. Somebody tell that asshole's name. What was his name, bro? Mining Tamiza 1169. You goddamn stupid cheater.
Holy [ __ ] bro. I don't give a [ __ ] if you're cheating, but the fact that you're [ __ ] flexing in my stream, like, I am I'm crashing out here. I'm crashing out here because I can't solve I can't solve questions. But this [ __ ] his flexing, cheating, his copy pasting skills, bro, I'm gonna beat your ass, bro. This [ __ ] bro. Reporting him. Absolutely. Why the [ __ ] didn't lead code lead code should have should have identified this him themselves, bro? Report this [ __ ] Coder Tamil S1, bro. This is the third question, right? Bro, peep. Why, bro?
Give me my give me my coins, dude. stupid leaked code.
He is storing input midway in a variable. He is a copy paste. Why didn't you ban him already?
Why didn't you ban him already?
Is he in the chat, bro? Is he in the chat? Is that yapper in the chat? Drao Nikl is a typical copying of vector by yeah bro that is that is what read why didn't bro the fact he was flexing on me bro first year student 4x4 bro shut your [ __ ] ass up first year student 4x4 4x4 he ran exactly exactly your student 4x4 bro did he not know about code lead did he thought we we think he's a he's a cheater come on Come on. Come on, bro. See, if you if you're cheating in lead code, it isn't it isn't any huge deal. You should not, but it isn't a huge deal. But the fact he's flexing when I'm crashing out, he's flexing.
He's flexing. Bro, now I know why cheaters don't play even after doing 1K question. Man, bro, you should not flex, bro. Nobody would have given a [ __ ] But he's like first year student four by four. He typed that four to five times, man. Oh my god, bro. Bro, another day go another day. Another W by code lead, bro. Code lead is such a good extension.
I can do question four. You can't, bro.
You and him are saying you cheat from chat. Jason Jassen on 3112. Are you saying copying from GPD? And first of all, I don't look at chat until the question ends. Until like if you see like Kin Park was himself crying about the fact that I'm not looking at chat today. I'm not looking at chat today. There's no way we are same. We are no same.
That guy is a Tamil guy and I'm also a Tamil guy. I'm sorry for that [ __ ] bro.
Well, you don't have to be [ __ ] It's not nothing about communities. Everybody cheats. There's nothing about communities. Chill, bro. Get me tested, bro.
Tested for what? Tested for what? Review mine, bro. What's up? What's up, bro? I know you're not a cheater. Chill out.
Chill out, friend. I woke up at 8:30 today just because this guy got an all kill. He woke up at 8:30 today because he get he got an all kill.
He got an all kill. 404 notash.
Hold on. Zephy, bro, I know you don't cheat.
I know you don't cheat, bro.
404 not cash. Let's see.
69, bro. If I'm following you, of course you don't cheat.
Let's look at his bro. Let's look at his 1781.
This is a large page. What do we think of this now?
Bro, Zephy, bro, what is this? Should I check it? Should I check it? Bro, should I check it? Bro, bro, if you English, bro, I don't know. It's I think it's probably some stupid settings. It's some stupid settings from YouTube, bro. No way.
Then bring him.
Maybe for sorting logic, bro. It's a large paste. Oh, yeah. Oh, yeah. This is This is probably that this is probably that custom hash for sorting, bro. I know Zeffy, bro. Zephy doesn't cheat.
See, he does not. Yeah, that was custom hash. Custom hash where you had to sort by w frequency.
Fair, bro. Fair.
Fair. Not bad. Should should I run code lead on myself?
Should I run code lead of my on myself?
Oh, I'm so ass.
It's manual.
Manual.
Manual.
Manual.
Manual. Fair, bro. Fair, bro. I'm clean.
I'm clean. Extension name, bro. Just go to the description. It's code lead. I just wish we win today. Even with all this [ __ ] beating Va would be generational, bro. We got some We got some uh football fans, sir. Free. Okay.
What's up? Reply please. Oh, sorry, bro.
I would. I would. I would. I would. I would. Sorry, bro. Sorry, bro. Who retracted Sarak's message? Who retracted Sarak's message?
Check my ID. Ques Goel, bro. Sharie, I know you don't cheat, bro. I know you don't.
Ques Goel04 1979, bro. If you have you have 67 contest, you're 20,000. Why would you cheat? Why in right mind you would would you even cheat? Bro, we know you don't cheat. Chill out, brother. Chill out.
Obviously, it's manual. We see you typing on lead code editor. Yes, sir.
Yes, sir. Having paneer paratha.
That's crazy, bro. What happened to you today? Nothing has happened.
Bro, this English translation should stop, bro.
This English translation should should stop. I need to probably look at a few settings after the stream, bro. Channel level settings.
Bro, what was that large paste was in yours? I I didn't check, but I'm pretty sure it's that custom hatch. How much you solve? We solve three. We saw three.
Follow me, bro. Okay, bro. Okay. Sh, bro. If you if you pass the code lead test, bro, we follow you.
We follow you.
Yep, it's clean. Yep, it's clean. Why did you get a 19k rank?
What? Bro, we follow you.
We follow you, man. I'm I'm fed up, bro.
I'm I'm frustrated today. I'm frustrated today, bro.
Yeah. Hell no.
Bro, how much time is left?
>> We have 9 minutes. Fable cake is for whole CS batch or for your class only.
It was for CSC batch and only like I think in even in my batch not more than 50 60 people came. Everybody was busy.
Everybody was busy.
>> Follow me, >> bro. You know what? Let me just go to my following list and follow everybody who follows me.
See, let me just go in here.
I have 305 followers. Follow, follow, follow, follow, follow.
Okay, bro. Fair.
Follow follow.
Fair. DevOps engineer associate.
Fourstar code chef. What the hell, bro?
What the hell?
DevOps engineer associate info. Fourstar code chef special code forces. Yo, and he doesn't even code. He started in 21.
Okay.
Yo, crazy profile, bro.
He's from Chandigard University.
chill out. No, let's do entrant hub, bro. Do we do we have the to do entrant hub today?
See my questions are so there's no way like just absolve after every contest.
Did Shayan attend today? He did. He getting a minus 12 despite getting a 3k rank. That's crazy, bro. What about what about Saruk?
Sarak again 62. Bro, would this guy stop aura farming for once? Would this guy stop aura farming for once? How can you be so goddamn good?
He's 600 rank, bro.
600 rank. Can this guy stop being so good?
Wow, it's crazy. Check mu minus 28. No [ __ ] way at 8.6k rank.
Geeky, bro, do the third question. What are you doing? Do the third question.
You didn't do the third question.
I should all follow me, bro. What's your ID? The third. Oh [ __ ] [ __ ] Bro, I got penalty on first. What? Penalty on first. Yo, penalty on first. What are you doing, bro?
Penalty on first.
Let's search for cash.
Minus 11, bro. Let me just search for myself, bro.
minus 12.
Bro, you know what, bro? Let's have a talk.
I feel like I should take a break from giving contests because if you see my past contest performance, in one contest I'm gaining rating, next contest I'm dropping. I feel like I should just stop giving contests for like five, six months and just focus on getting better.
Bro, I can't I can't get better during weekdays. I have my job. I don't have time on weekends. All lead could I do is just give contests, bro. I think I should probably just stop giving contests.
I just cannot reach 1900s.
Yeah, bro. You You saw what happened today. Should I just stop giving contests at this point?
This is crazy, bro.
- 12 + 5 sala for a reason. Like, look at 9:00 a.m. games, bro. Negative.
Sinister like look at this [ __ ] I hope you're not talking about my hairline.
Knight is so fat. Who is Guardian or everyone? Night, bro. Look at that goddamn Sarth, bro.
Look at that goddamn Sarak.
Like, bro, every contest I'm losing rating, bro. I think I should just stop.
Sad. He's getting 2k rank plus 63.
Yo, congrats, brother. Don't make me jealous.
We should start a new ID, bro. I I'm considering it, bro. A new ID.
New ID. Bro, you have five weeks to get be better. And even I stuck at 1900, bro. I can't I can't practice lead code on weekdays. I have my job, bro. Oh, this is one of my first bad morning contest. Shaitan, how are you lo losing rating today?
How are you losing rating today? He can't see my chat gang, bro. I can I can Hanu, I can. Hanu Hanu gaming.
I'm losing for like past two, three contest continuously. Should we stop and do study streams?
Bro, I I don't know.
I'm tired of this [ __ ] every contest I go to go I go to entrant hub and see okay I'm losing rating like if if you look at my graph bro if you look at my graph it was very good till this 1932 I once reached 1932 down up down up down now yesterday I went up now again I'm going to go What even? What is this life? My hairline is receding. I I don't have female interaction and yet all I do is just lead code. I think I should rethink my life priorities, bro. This is crazy, bro. This is crazy. Life was good until 1932. Exactly.
Exactly, bro. I I think plus one even my stat is invisible. It is visible, bro. I think I should rethink my life priorities, bro.
I goon every day. I I have receding hairline. I don't talk to women and I just do lead code contest and I lose rating.
You only have 30 minutes at max, bro. I do.
Yo, that's Man, I'm sad as [ __ ] today. Today I'm sad today. I'm sad. I'm sad as hell.
You going every day? Sorry, bro. To be honest, thanks for honesty. But who said Ion every day? That was I didn't say that. I didn't say that, bro. Thinks he's tough after cheating from chat. J.
What? J Jason Json Frey 3112.
You know what? Okay. I'm a cheater.
That's it. You win. You win. JSON Frey 3112. I'm a cheater. Fair enough. Fair enough.
Yo, Supreme Cosmos, stop spamming that.
Stop spamming that. Stop spamming that.
I hope you all don't laugh at me. I got two penalties in first question yesterday.
Fair enough. Fair enough. Okay, bro.
I saying something. Yeah, bro. Sorry to be honest.
N2 pass contest.
This time my friend just [ __ ] up and irritated me. That's why. But I do know the logic. I don't know right in English. I don't know T. I don't know T.
I don't know T.
Yo, Amit Kumar019, bro. Thank you for the 40 rupees, my brother. DM me on Insta for my private hairline pictures.
He says, "In interview scheduled on next Sunday, hack within feet. Nervous, bro. I'm praying for you. I'm rooting for you. You're going to get that job. I hope it's that L3 profile, L3, L1, whichever 21 LPA. Yo, good luck, brother. Next Sunday, you have an entire week to prepare. Let's hope, bro. Do good CS fundamentals." They ask CS fundamentals, your projects and all that. God damn. Knight is 1900 plus now.
Is that No, bro.
No. Knight is 1850. Why are you not showing code? Because the contest just ended. So I can show my code right now.
Choose one. Physical with multiple women or two good female friends? Content worse. What the [ __ ] are you asking me, bro? You're asking that question to a man who has never shaved a woman's hand?
What's your rank in this contest? Let's check my rank. My rank in this contest.
It's 6.8K.
Yeah.
Yeah. You know what, chat? I think one good thing we can take away is this.
Let's report cheaters. Let's report cheaters because if you report cheaters, you and they get banned, you get coins, bro. You get coins. Let's see if Ange Gupta cheated.
Let's see if Ange Gupta cheated.
Looks like he did not, bro.
So at 114 eggs.
Yo, this guy is cheating, bro. This guy is changing his approaches like every every goddamn five minutes, bro.
Whoa. I don't even know. Yeah. Nah, bro.
Let's not do this. Let's not do this.
Let's not do this. Bro, can you tell me how to download that code? Lead, bro.
Just go to my GitHub. Just go to my GitHub, bro. Just check variable name.
What? What was the variable name? Lead code. Bro, look at look at goddamn This is I Isan. This is Ishan, bro. That guy is an inspiration, bro. Can I ever reach his level? I don't think so. Ever in my life, bro. What was his variable name?
Yo, this guy's cheating. This guy's cheating.
Check his variable name he cheated and copy pasted from fair.
I hope I get my I didn't fix bro. At least I didn't mean to do that. Sorry, bro. You cheated. You cheated mining the but you you cheated. We saw that. Never shakes a female hand. Bro, that's another level of loneliness.
What do I even say at that point? What do I even say, bro? Be a man. Let's discuss solutions. Okay. Okay. Let's discuss solutions.
Let's discuss what [ __ ] happened today. What [ __ ] happened today.
The first question. I don't think so we have to talk anything about the first question. Let's go to the next question.
Stupid question.
Pure implementation question. I don't know what could we even do here. your implementation question. I don't think so there's anything to discuss here.
Yeah.
Is there anything to discuss in the second question?
Does anybody wants to discuss anything in the second question? Don't disclose the variable trick, bro. Yeah, you're right. What about your placements, dude?
Bro, I'm placed.
My 128 day streak was broken yesterday, Chad. You know what? That gave me a good reminder. I am I am at a streak of 356.
I'm at a streak of 356.
In just 10 days, I'll reach an entire year of lead code every day. I'll reach a stage wherein I lead coded every day for one goddamn year. After think I should I think after that I should retire. Bro, in that one year I started giving contests. I reached my peak rating of 1932.
After that I've been losing rating but I think after that one year mark I should retire but this is not helping me in any way like I'm not able to gain rating every stream I just come and cry about people say I'm I'm I'm cheating and every stream bro I just cry about how my rank is going down bro let's just end it at 365 I feel like how many shallow submissions you did.
What do you mean by that? What do you mean by shallow submissions?
Guess guess my streak, bro. Let's check, bro.
Shatan 366. 10 more days than me. 10 more days than me. You cannot be God. You are God's own son, Tanzan. Bro, you're not from India.
Shatan, bro, you're not from India. The [ __ ] bro? Where are you from? Just 25 contests. Yeah, this guy is [ __ ] auto farming, bro. This guy is auto farming.
That little hairline of all, bro. Did I show my hairline?
Did I show my hairline?
No way.
What's the point of that when you cheat?
I agree. Why is your channel name Purish? Like your real name is, right?
Nah, bro. Pish is like it's it's a nickname I've given to a street dog and I really like him. That's why I named my channel Kish. Like just submitting for streak. Oh, a lot of the days. A lot of the days, bro. It's not that I'm solving one question every day, but a lot of the days I did do a shallow submission. New meme face unlock today. What?
Third question approach. Third question approach. Okay, let's let's take a look at the third question.
For the third question, we maintained a hash first of all, a hash that stores every number in your nums. Now, what we do is now what we do, we go now what I'm doing is for every number in your in your Let me remove the extra code.
Let me remove the extra code.
Now what I'm doing is for every number I'm going to square root of that number and finding every divisor of that number and I'm storing that divisor into a set.
Like if I is dividing element I'm storing I and L minus I into a set. Now find the smallest divisor that is present in the in our array. So I'm going temp stores divisor divisor. DIB stores all the divisor. This is a single divisor. I'm and I'm seeing if that divisor is present in our hash. If that is we'll just add that to our answer.
That's it, bro. That's how I did it.
Let's see how fast my was.
Let's see how fast my solution was.
submissions reach 8%. I don't care. I don't care.
That's how I did it. Brother how much?
Three, bro. Three. How many questions did you solve in every platform? 100 on code forces and probably 10 20 on geek for geeks. That's it. C would be faster.
Yeah, bro. I I need to revise you of Aras thought. You barely passed. Yo, shut up, bro. Shut up. I did. I did in the end. I did in the end. Hello, Enron Hub. Did you see Kavish?
Kavish, if you're not attempting contest, you cannot ask me to see end.
You cannot ask me to see entrant hub.
How do I reach 3x4 in contests?
Bro, I can barely do three questions.
harassing me because I was fed up. I was fed up and also I don't think so I could have solved it. This is solved using digitra.
People are saying I'll add this in my tudu. This week both the questions were in on digitra. I'll add this on my tudoo.
Yeah, bro. Honestly, I'm not happy. [ __ ] me.
I'm like four simple.
Wait, then how are you able to build logic without much of a practice? I've solved 500 questions already. What do you mean without practice? Try both yesterday's and today's QD.
Nah, bro. Today's fourth question. Nah, bro. Not right now. Suk, bro, I'm about to end stream. Apologize for that SIT thing, bro. Sorry. Mining Kame16. Chill out, bro. It's all cool. It's not like you've done a lifelong jail or anything.
Chill out. Chill out. The only thing I was mad about was that you were flexing, brother. And even that doesn't matter.
Flex. If you're good at it, flex, but please don't flex if you're cheating.
Nikki Priya, check her profile. I'm about to end stream, bro. No scribble.
No scribble or anything. I'm I'm disappointed as hell on myself today.
I'm disappointed as hell. Nikki Priya.
Nikki Priya.
What? What do I even check in here?
Heritage Institute.
Like, bro, what what do I even check here? This is just 38 questions. Who sent me this ID? Check her profile and her rank of this contest. I can't check her rank of this contest.
I can't. Bro, I DM'd I DM'd copy paste her on LinkedIn. Let's see if he replied.
Let's see if he replied, bro. Messaging, sir. Bro, should I message him again?
Bro, he's ignoring me.
He's ignoring me. You know what? Let me let me not reply.
Her submission. Okay. Okay. Okay. Okay.
Her submission. Yeah, you're right.
Minimum number of jumps to reach the last index. Was this a question in today's?
This was not even a today's question, bro.
Was this a today's question?
What? I Bro, I can't even remember.
Yeah, this is this is not even today's question. Minimum cost to buy apples valid minimum uh this is the question I got got that yo yo are we looking at this I don't know bro I don't know this does not look legit what now we I don't care at this point I don't care I don't care at this point them cheater hush you show up on Discord I don't care if you even cheated just do what you like. I don't care part saw that, bro.
Yo, that was See, fair enough. Fair enough.
Tell us about your placements in a in a new video. What do you want to know about my placements? What do you know about my What do you want to know about my placement? Are you looking for a job?
My company is looking for SD1s. Yo, yes 394, my brother.
Can we DM on can we DM on link then suppose you get a wrong except in a lead code you can see the test cases but in a way you can't what to do in that case bro you know in in then just see that that's tough because if you see the test case you can dry run and see where your logic is going wrong if you cannot see the test case then it's two times tougher it's tougher it's tougher bro because yeah I agree And I get bamboozled there. I got 8k rank. Was able to solve one and three.
Nice, bro. See how the test cases.
Oh, Praep. Oh, exactly. If the test case is wrong, just if the test case is hidden, just see see out it.
That's Yo, why did I never think of that? Yo, that's genius.
That's genius, bro.
We can just see how the test cases. Just see how the test cases, bro. Exactly.
Okay. Is 9:40?
I'm going to go have breakfast.
Let's check Discord if there's anything on Discord. Second contest could solve only for second. AMV bucket burps. Bro, you're in for a deep dark journey, bro.
This is not a This is a hell hole, bro.
Lead code contests are hell hole. Holy trick. Exactly, bro. I never think I never thought of that.
I never thought of that. Like how did your interview go and all that fair bro? Do you do you guys want me to make a video on that?
Do you guys want me you guys be interested?
Okay. Can anybody tell me why is the output different? Ignore the solution.
Standard out.
Output.
What is even 912?
Yo, what where is lead code, bro? Lead code is [ __ ] stupid. This guy's expected output is 21. His standard output and output is 21. That's crazy.
Lead code is stupid, bro. Lead code is stupid.
Get your receding hairline got fixed or leave your job. What would you choose?
Get my hairline fixed or leave my job.
Oh my god.
Oh my god. Oh, bro. It get worse every day.
I don't know, bro. Probably have my job.
Even if I get my hairline fixed, who would want like unemployed here? Damn.
Got the answer. Shut the [ __ ] up. Shut up. I have applied oil. That's why I've applied oil, bro.
I have applied oil.
I have applied oil, bro.
Aaral Aaral, please check his bro. I don't care at this point. Even if he is, bro.
Good for him, bad for him. That's it.
999 K out of thousand. Damn. That's not unemployed. The [ __ ] you saying? No.
He's asking if I get my hairline fix or lose my job. I would I would I would much rather have a receding hairline and a job and a job. Wearing a cap increases baldness my does he does does it does it bro does it get that haircut bro my hairline is hair if I get a buzz cut bro it's going to reveal everything whether the more you notice your hairline notice losing hairs yeah fairy Shut the [ __ ] up. That's it for this day then. I'm fed up from Le code, bro. I might as well quit streaming. [ __ ] League code.
I'm just losing rating, bro. Let's hope next week it's a good week, bro. But yeah, just go bald. Trust me. Like, look at these guys. I'm talking about losing rating. He's telling me to go bald. He's telling me to go bald. or bro hairline improve like look at the advices in the chat going improves hairline chill guy bro if that actually did I would have my hairline till my eyebrows if that thing was true man don't wear caps for long yeah just wear caps on stream okay then hold on hold Yeah, I'm muted. Okay.
You said you good every day. Goonist. I did. I never said that. Why my chat is not showing to you? It is. It is. I never said that.
Let's end this. It's on my headline, bro. Discord. I ain't lying.
Shut up. Shut up.
What time is it? It's 9:47. 9:47. That's it for this stream then. Liar. Shut up.
I Let's hope next week is a good week or else I'll actually quit lead. I can't I can't tolerate this anymore.
Have a good week. Bye-bye.
Thanks for joining.
Related Videos
Escaping the Fog
LogicLemurGaming
760 views•2026-06-03
Olympiad Mathematics | Indian | Can You Solve This One?
PhilCoolMath
650 views•2026-06-03
A Brutal Radical Expression Made Easy! The Shortcut Changes Everything.
tamoshop
112 views•2026-06-02
V : jee main /advance class 11 mathematics : Binomial Theorem class-1 ( 29 may 2026 )
dcamclassesiitjeemainsadva9953
125 views•2026-05-29
Is This Pentomino Tileable?
3cycle
241 views•2026-05-30
This Sudoku Has Many Lines!!
CrackingTheCryptic
2K views•2026-05-29
Olympiad Mathematics | Indian Can You Solve This One?
PhilCoolMath
268 views•2026-06-02
Olympiad Mathematics | Indian | Can You Solve This?
PhilCoolMath
669 views•2026-06-02











