Тёмный
Glitched Failure
Glitched Failure
Glitched Failure
Подписаться
Roboto Sans | PicoCTF
5:05
5 месяцев назад
SQLiLite | PicoCTF
2:05
5 месяцев назад
More SQLi | PicoCTF
10:14
5 месяцев назад
SQL Direct | PicoCTF
1:59
5 месяцев назад
Client-side-again | PicoCTF
15:01
5 месяцев назад
Secret | PicoCTF
4:19
6 месяцев назад
Palindrome Index | HackerRank (JavaScript)
7:17
11 месяцев назад
Happy Ladybugs | HackerRank (JavaScript)
7:25
11 месяцев назад
dont-use-client-side | PicoCTF
2:53
Год назад
Login | PicoCTF
6:24
Год назад
Logon | PicoCTF
2:37
Год назад
Big Sorting | HackerRank
5:12
Год назад
Equal | HackerRank (JavaScript)
12:02
Год назад
Shop | PicoCTF
4:46
Год назад
Trie Tutorial (Python)
24:50
2 года назад
MinHeap Code Refactor (JavaScript)
47:34
2 года назад
Almost Sorted | HackerRank (JavaScript)
12:38
2 года назад
Larry's Array | HackerRank (JavaScript)
11:30
2 года назад
Комментарии
@HD_Heresy
@HD_Heresy 3 дня назад
I swear sometimes the hardest thing about CTF is thinking you're solving it "wrong" or "too easily" so you spend ages looking for the correct way, only to watch videos on youtube of people just basically doing it the same way you did 😂😂
@shafdfsvh356
@shafdfsvh356 10 дней назад
good
@ahmaadmohd
@ahmaadmohd 25 дней назад
Extremely helpful! But I have a question regarding the very first __init__ function and the “self” that keep repeating across the code. Would be very helpful if you can explain this point 2:30
@GlitchedFailure
@GlitchedFailure 25 дней назад
Sure thing. In Python, when we define a method, or function that will belong to an object, the first parameter is always a self reference. Technically, we can call the self reference whatever we want, but the standard is just "self". That way, we can refer to the object itself and grab properties or other methods from it to be used within the method being defined. We can also use it to set properties on the object, which is what we see a lot during the __init__ method. Let me know if this explanation is clarifying. I know class definition and the idea of objects can be confusing (it's all so abstract!). Thanks for watching!
@johnnash6467
@johnnash6467 Месяц назад
Thank you for the Video, I tried on my own and went into a complicated solution. It is easy once you understand the problem
@manojkumarparuchuri5920
@manojkumarparuchuri5920 Месяц назад
Nice one
@MehiBee
@MehiBee Месяц назад
It works, thanks!
@santiso878
@santiso878 2 месяца назад
my solution: function migratoryBirds(arr) { // Write your code here const counts = {} arr.forEach((x)=> counts[x] = ((counts[x] || 0) + 1 )) let maxBirdKey for(let key in counts){ if(!maxBirdKey || counts[key] > counts[maxBirdKey]){ maxBirdKey = key; } } return maxBirdKey }
@VishalYadav-gk1kg
@VishalYadav-gk1kg 3 месяца назад
Very nice explanation sir, Thank you!
@profd808
@profd808 4 месяца назад
2:41 hahahhaha, it had me down rolling🤣
@oii0712
@oii0712 4 месяца назад
Im lost 😂 but I loved the explanation ill have to watch it again
@GlitchedFailure
@GlitchedFailure 4 месяца назад
No worries - it took me a while to get, too. Thanks for watching!
@user-cr4rn4hq3u
@user-cr4rn4hq3u 4 месяца назад
I often feel like been fooled when i try to do hackerrank in the leetcode way
@bolshoi762
@bolshoi762 4 месяца назад
best explanation over here, congrats
@GlitchedFailure
@GlitchedFailure 4 месяца назад
Hey, thanks! And thanks for watching! 😀
@bobbyrandomguy1489
@bobbyrandomguy1489 4 месяца назад
This one was weird for me. Every video I saw has done it the same way you did. It wouldnt let me login with anything at all. Always came back 404. But if I put in the URL with /flag it just gives me the flag. Either way. Thanks!
@MuneebKhan
@MuneebKhan 4 месяца назад
Have a look on this approach too function queensAttack(n: number, k: number, r_q: number, c_q: number, obstacles: number[][]): number { const os = new Set(obstacles.map(([a,b]) => `${a}_${b}`)); function st(rowOp: number,colOp: number): number { let steps=-1; let row = r_q; let col = c_q; while(!(row < 1 || col < 1 || row > n || col > n)) { if(os.has(`${row}_${col}`)) break; row += rowOp; col += colOp; steps++; } return steps; } return ( st(+1,-1) + st(+1,0) + st(+1,+1) + st(0,+1) + st(-1,+1) + st(-1,0) + st(-1,-1) + st(0,-1) ) }
@GlitchedFailure
@GlitchedFailure 4 месяца назад
This is a much nicer approach. Using the set lookup is efficient and reworking the logic for each direction as parameters is very elegant. Well done and thanks for watching!
@MateoVidal
@MateoVidal 5 месяцев назад
you are using the rotation rule wrongly
@GlitchedFailure
@GlitchedFailure 5 месяцев назад
Hi. Thanks for watching. Could you tell me more about what you mean? If possible, could you provide an example?
@ildgz
@ildgz 5 месяцев назад
Hi! Awesome. This looks like a KWIC ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-b2SQDH2hh68.html
@Shanuraig
@Shanuraig 5 месяцев назад
out of 30 test cases this logic passes only 3
@GlitchedFailure
@GlitchedFailure 5 месяцев назад
Hi. I just reran my python solution code (found in the description) and it passed all 30 tests. Can you provide the code you tried?
@arjix8738
@arjix8738 5 месяцев назад
kinda weird that you know what a hexadecimal number is, but you don't know the most common representation of it? PS: Do you have short term memory? (I am not trying to be mean) Cause like, you instantly forgot what a function you just analysed does...
@GlitchedFailure
@GlitchedFailure 5 месяцев назад
Hey, thanks for watching! I don't really work with hexadecimal numbers too often, so it took a bit to remember how they work. I'm not sure what you mean about forgetting a function. Which function do you mean? I fully admit I'm not the best programmer - after years on the job, I'm still learning 😀
@arjix8738
@arjix8738 5 месяцев назад
@@GlitchedFailure the to_num function, as you initially named it
@GlitchedFailure
@GlitchedFailure 5 месяцев назад
@@arjix8738 Oh, haha, yes! Good catch. I was thinking about the first step of the function, but completely forgot about the second step indexing the list😅
@sezerozer382
@sezerozer382 5 месяцев назад
thanks
@melueri
@melueri 6 месяцев назад
Omg, I don't know why no one has wrote a comment here, but thank you so much your explanation was perfect
@GlitchedFailure
@GlitchedFailure 5 месяцев назад
I appreciate it. Thanks for watching!
@user-oo4on5lg9m
@user-oo4on5lg9m 6 месяцев назад
I got the this stage, i was not understanding I had to see a work through 😢, thanks man
@konstantinanthonyromanov6952
@konstantinanthonyromanov6952 6 месяцев назад
Very helpful! Thank you.
@user-sg7eo9wk4e
@user-sg7eo9wk4e 6 месяцев назад
nice explanation!!
@vickyeee4232
@vickyeee4232 8 месяцев назад
Very Simple Solution: # Write your code here for i in a: if (i.isupper() and i not in b): return "NO" for j in b: if j not in a.upper(): return "NO" return "YES"
@danielcampseats1756
@danielcampseats1756 5 месяцев назад
this is not right
@bermudesviana
@bermudesviana 8 месяцев назад
Awesome, thanks for the explanation
@GlitchedFailure
@GlitchedFailure 8 месяцев назад
You're very welcome. Thanks for watching!
@skinnycucumber
@skinnycucumber 9 месяцев назад
Thank you!!
@GlitchedFailure
@GlitchedFailure 9 месяцев назад
You're very welcome. Thanks for watching!
@MadhusudhanParlathaya
@MadhusudhanParlathaya 9 месяцев назад
for input of GAAATAAA the hackerrank solution says correct answer is 5 but minimum value can be 4 as we can replace 4 A's out of 6 with G T C . AM i right this way?
@GlitchedFailure
@GlitchedFailure 9 месяцев назад
The key limitation is that we can only replace a CONTIGUOUS substring. So you are correct about replacing the four A's in your example of "GAAATAAA", but in order to get those A's we have to include the one T - even if we are not changing it. Let me know if that makes sense, and thanks for watching!
@siddhartht8063
@siddhartht8063 9 месяцев назад
It will be helpful, if you provide the explanation document.
@GlitchedFailure
@GlitchedFailure 9 месяцев назад
Oh, do you mean a link to the code? I put it in the description, but here it is again: gist.github.com/Shaddyjr/88d3babf082fe869bc550a42ee56f6e0 I hope that helps!
@khanaleena1161
@khanaleena1161 9 месяцев назад
what the heck man ,how do we grasp this
@anoopshetty3580
@anoopshetty3580 10 месяцев назад
let b = [] let c = 0 for (let i=0; i<a.length; i++) { for (let j =i+1; j<a.length; j++) { if (a[i]==a[j]) { //console.log(i,j) b [i] = j-i c = 1 } } } let min = b[0] for (let i=0; i<b.length; i++) { if (min>b[i]) { min = b[i] } } if(c==0) { min = -1 } return min my code
@TheAxelgr
@TheAxelgr 11 месяцев назад
Thanks man
@erikrichard413
@erikrichard413 11 месяцев назад
Great explainer! I was stumped on this one for a couple of days. I was able to get all tests to pass except #8 which failed due to time complexity. Going through your solution I like how you declared useful variable names instead of trying to keep track of what q[i] -1 is supposed to represent. Thanks for helping me understand how to solve more efficiently.
@ivss8927
@ivss8927 Год назад
Same as Joshua I did a lot of Math.min and foor loops in a first solution, but i was suspecting that i made a lot of inecesary stuff haha Thanks for the content
@ashwnicoer
@ashwnicoer Год назад
very neat explanation .thanks
@ultrananas4873
@ultrananas4873 Год назад
I think you missed the point but still got the flag haha. actually you can't login to "Joe", but since you used a lowercases "j" to "joe" you still logged in. The manipulation you did work with every user/password
@alan5793
@alan5793 Год назад
I did not come to this, or rather, I just thought that it was impossible (although it turned out I did not try). but I managed to outweigh the balance to a positive value by selling a large number of products with a minus sign (such as -123456789 flags). thanks for the solution!
@Marcus-sn1si
@Marcus-sn1si Год назад
this is wonderful, thank you.
@spaghettiking653
@spaghettiking653 Год назад
Definitely an interesting solution, nice one! I wonder why you couldn't just sort the original list straight-up for the same time complexity? Surely just `return sorted(unsorted)` would do the trick? Another question I thought about here was the true time complexity of sorting the strings: because they're stored in string format, and we can't (maybe in python we actually can, but nvm that for a moment) convert them directly to an integer, which has O(1) comparison using a CPU instruction, surely when comparing two strings when sorting, we in fact need to compare every character separately...? The only thing I can't tell is whether this introduces another factor into thr time complexity or not, because it definitely seems like more work, but is it technically constant because the inputs are no more than 2*10^5 in number?
@GlitchedFailure
@GlitchedFailure Год назад
Hey, thanks for watching! I didn't go into detail about sorting the list of numeric strings as it is, but doing so reveals 2 big problems. The first problem is that programming languages have an upper limit on how big an integer can be (as well as be reliable & "safe"). In python the max unsigned integer is 18,446,744,073,709,551,615 (as a string this would be 20 characters long) - meaning any number larger than this cannot be held in memory. In JavaScript, the max safe integer is 9,007,199,254,740,991 (as a string this would be 16 characters long). This is why we cannot handle these numeric strings as integers, they're just too big having a length of way more than 16 or 20 characters. So, we have to sort them as strings, which reveals the 2nd problem. Strings are sorted lexicographically, which is similar to how words are sorted in a dictionary. "A" goes before "Axe", which both go before "Be" - the same way numeric strings would be sorted as "1" goes before "183", which both go before "23". The sorting we need still has to use lexicographical sorting, but in such a way that it results in typical integer sorting. Hence the added complexity for the solution. In the video, I do make an error regarding the time complexity. I should have used a proper variable to denote the length of the string, it's not constant as I implied. Each string gets compared and is sorted for each string, so the total time complexity is more like O(k*nlogn) Let me know if that doesn't make sense.
@davismuchiri5536
@davismuchiri5536 Год назад
Thanks...really helpful
@GlitchedFailure
@GlitchedFailure Год назад
Glad it helped. Thanks for watching!
@Nature-pb9dh
@Nature-pb9dh Год назад
Your explanation is very useful. Thanks
@jatinbhardwaj9020
@jatinbhardwaj9020 Год назад
Please Give Code In Java Also Soon Plz.
@marcelobour
@marcelobour Год назад
I think this is a very good explanation but if you want to become more popular slides need to be improved. The algorithm part can be improved a lot with some more air and a few colors. Top channels has pretty visuals (sometimes messy) but it helps create your style. I believe, this aproach, like "debugging", is very appreciated by juniors like me, but often is a like hard to follow. Thanks for the video.
@GlitchedFailure
@GlitchedFailure Год назад
Thanks for the feedback and thanks for watching!
@dar1n_fgp
@dar1n_fgp Год назад
How long have you been coding to be able to do this?
@GlitchedFailure
@GlitchedFailure Год назад
I'd say I was coding for about 3 years at the time of this recording.
@shashwatbhatnagar659
@shashwatbhatnagar659 Год назад
Sir What is exactly x-label and y-label in the histogram??
@GlitchedFailure
@GlitchedFailure Год назад
Good question! I really should have labeled them when I made this video 😞 The Y-label should read "Count of players" and the X-label should read "Player position when game ends".
@mouadtaoussi42
@mouadtaoussi42 Год назад
Thanks for these precious informations !
@7guitarlover
@7guitarlover Год назад
This is such a great explaination ! Thankyou so much =)
@dickheadbeaniss4897
@dickheadbeaniss4897 Год назад
Thank you so much for giving me a great idea for solving the problem !!
@GlitchedFailure
@GlitchedFailure Год назад
You're very welcome. Thanks for watching!
@aashusingh979
@aashusingh979 Год назад
the solution is absolutely wrong , all trhe test casses are failed.
@GlitchedFailure
@GlitchedFailure Год назад
Hi, I just tested the solution I provided and it passes all test cases (for JavaScript). Is that the solution you're referring to?
@eldattackkrossa9886
@eldattackkrossa9886 Год назад
i can't believe you have this few views, great video quality :) just one small question, im not very well versed in neural networks (i've listened to a lot of explanations but never written one myself) but should the validation set really be sequential? i was thinking there might be some correlation for the first few numbers that doesnt hold in the long run and that it should probably be randomly selected. thanks for answers!
@GlitchedFailure
@GlitchedFailure Год назад
This is a great question! In short, the validation set does NOT need to be sequential and is often randomized, like you suggest. In my example, I was keeping things simple for the sake of explaining. However, a train_test_split is appropriate and practical for the reason you mentioned. The only consideration is that we need to be consistent in how we handle the split to ensure the test input (X_test) and expected output (y_test) remain aligned. The scikit-learn package offers a helpful function for this called `train_test_split` (scikit-learn.org/stable/modules/generated/sklearn.model_selection.train_test_split.html). This essentially takes the total input (X) and expected output (y) and randomly selects indices returning the training input and expected training output (X_train & y_train) as well as the testing input and output (X_test & y_test). Thanks for watching!
@eldattackkrossa9886
@eldattackkrossa9886 Год назад
@@GlitchedFailure cool, thanks for explaining! :)
@jensBendig
@jensBendig Год назад
Thank you. I see that this approach is solving it. What I don‘t quite get is this: Why can‘t I just compare the rowsums with the colsums? imho rowsum(i)==colsum(i) - otherwise impossible. (I tried that, but doesn‘t work for all tests.)
@GlitchedFailure
@GlitchedFailure Год назад
I totally get where you're coming from. It wasn't clear when I was first doing this either. Let's look at an example that I hope is clarifying: 5 1 3 1 5 2 2 3 5 Each row is a container. - The first row/container has 9 balls in it, which means it can only ever hold 9 balls (given the swap mechanic). Let's call this container A. - The second row/container has 8 balls in it (container B). - The third row/container has 10 balls in it (container C). Each column is a unique color - There are 8 balls belonging to the first column/color. Let's call this color Red. - There are 9 balls belonging to the second column/color (color Blue). - There are 10 balls belonging to the third column/color (color Yellow). We have one container that can fit each color: - Container A can hold color Blue - Container B can hold color Red - Container C can hold color Yellow However, if we just compare the row and column sum by their original index we'd have a problem, since there is no order enforced on which containers or colors are listed first. - row 0 (container A) holds 9 balls, but column 0 (color Red) only has 8 balls in total. - row 1 (container B) holds 8 balls, but column 1 (color Blue) only has 9 balls in total. - row 2 (container C) holds 10 balls and column 2 (color Yellow) has 10 balls in total, so this happens to work out. If we sort the counts for rows and columns then we can line them up by their new sorted index. - sorted row list 0 holds 8 balls (this corresponds to container B), which can hold sorted column list 0 (color Red). - sorted row list 1 holds 9 balls (this corresponds to container A), which can hold sorted column list 1 (color Blue). - sorted row list 2 holds 10 balls (this corresponds to container C), which can hold sorted column list 2 (color Yellow). I hope this helps. Thanks for watching!
@jensBendig
@jensBendig Год назад
@@GlitchedFailure Thank you very much!