Errichto Algorithms
Errichto Algorithms
  • 139
  • 14 571 124
Prefix Sums - Problems, Code in C++ & Python
Prefix sums are the sums of the first K elements in an array. You can use them to quickly get the range sum and solve many other problems.
Range Sum - cses.fi/problemset/task/1646 or www.spoj.com/problems/CSUMQ/
Most Frequent - www.geeksforgeeks.org/queries-to-print-the-character-that-occurs-the-maximum-number-of-times-in-a-given-range/
Range Increase - www.hackerrank.com/challenges/crush/problem
Subarray Sum Equals K - leetcode.com/problems/subarray-sum-equals-k/
Product - leetcode.com/problems/product-of-array-except-self/
CF article - codeforces.com/blog/entry/86420
I stream on Twitch - www.twitch.tv/errichto
2nd YT channel - czcams.com/users/errichto2
zhlédnutí: 37 856

Video

I Lost In Google Hash Code 2022
zhlédnutí 61KPřed 2 lety
Going through my mistakes in GHC 2022 qualification round. [ad] Reply Code Challenge: replychallenges.com/346 Google Hash Code qualification round: codingcompetitions.withgoogle.com/hashcode/round/00000000008caae7 We should have coordinated better. I incorrectly thought that optimizing the order of doing projects is a bad idea. It's sad that strategic mistakes would be so easy to avoid. And usi...
C++ Caesar Cipher (ASCII Codes) | Algo for Beginners
zhlédnutí 46KPřed 2 lety
Caesar Cipher shifts every character by a constant. It's easy to code if we use ASCII values. Train&Win high school contest: challenges.reply.com/tamtamy/challenge/2022-teen-train-win-1 School registration: replychallenges.com/TrainAndWinProgramme2022 Homework: Day 1 P03 P04 P07 P09, hit "join" on the right to register and submit solutions codeforces.com/group/yg7WhsFsAp/contests 0:00 ASCII cod...
C++ For-Loops Range | Algorithms For Beginners
zhlédnutí 55KPřed 2 lety
Not sure if you should use N-1 or N-2? Let's practice how to use indices in algorithmic problems. CF Football codeforces.com/problemset/problem/96/a CSES Repetitions cses.fi/problemset/task/1069 LC Repeated DNA Seq leetcode.com/problems/repeated-dna-sequences/ 0:00 3 in a row 2:46 K in a row 4:34 code 7:49 homework I stream on Twitch: www.twitch.tv/errichto
Leetcode Biweekly #56 (2nd Place)
zhlédnutí 82KPřed 2 lety
I almost won leetcode.com/contest/biweekly-contest-56 Live-stream with more detailed explanation of Q3 and Q4 czcams.com/video/LBB2E69Qxc8/video.html 0:00 Q1. Count Square Sum Triples 0:46 Q2. Nearest Exit from Maze 4:56 Q3. Sum Game 10:09 Q4. Minimum Cost to Reach Destination 14:38 Results Subscribe for more educational videos on algorithms, coding interviews and competitive programming. - Git...
Google Code Jam 2021 R3 Screencast
zhlédnutí 40KPřed 2 lety
No-commentary screencast of GCJ Round 3, sorry about the sound codingcompetitions.withgoogle.com/codejam/round/0000000000436142 Coding live streams - www.twitch.tv/errichto How to practice? - github.com/Errichto/youtube/wiki/How-to-practice? Subscribe for more educational videos on algorithms, coding interviews and competitive programming.
Kickstart 2021 Round C (1st place)
zhlédnutí 216KPřed 2 lety
I won Google Kick Start 2021 Round C. Watch my screencast with commentary and post-analysis. codingcompetitions.withgoogle.com/kickstart/round/0000000000435c44 0:00 - Intro 0:35 - A 9:40 - B 16:16 - C 26:56 - D 52:06 - D, first submit 57:54 - done & solutions Coding live streams - www.twitch.tv/errichto How to practice? - github.com/Errichto/youtube/wiki/How-to-practice? Subscribe for more educ...
Google Code Jam Round 2 Screencast (full score!)
zhlédnutí 41KPřed 3 lety
codingcompetitions.withgoogle.com/codejam/round/0000000000435915 Subscribe for more educational videos on algorithms, coding interviews and competitive programming. - Github repository: github.com/Errichto/youtube - Live streams on 2nd YT channel and on Twitch: czcams.com/users/errichto2 & www.twitch.tv/errichto - FB and Twitter: errichto & errichto - Frequently Asked Q...
Google Code Jam 2021 Round 1B (6th place)
zhlédnutí 187KPřed 3 lety
My screencast and commentary of GCJ 2021 1B. Problems and leaderboard: codingcompetitions.withgoogle.com/codejam/round/0000000000435baf 0:00 A. Broken Clock 17:50 B. Subtransmutation 34:12 wrong submission 36:38 C. Digit Blocks 56:52 Summary Coding live streams - www.twitch.tv/errichto FAQ - github.com/Errichto/youtube/wiki/FAQ Subscribe for more educational videos on algorithms, coding intervi...
Sparse Table & RMQ (Range Minimum Query)
zhlédnutí 71KPřed 3 lety
Tutorial on Sparse Table data structure. We use it to solve Range Minimum Query by first storing minimum for every interval with a length equal to some power of 2. problem links: www.spoj.com/problems/RMQSQ/ & cses.fi/problemset/task/1647 code github.com/Errichto/youtube/blob/master/rmq_sparse_table.cpp Coding live streams - www.twitch.tv/errichto FAQ - github.com/Errichto/youtube/wiki/FAQ Dsic...
Google Code Jam 2020 1C Practice
zhlédnutí 18KPřed 3 lety
I'm solving an old GCJ round (2020 1C) in order to prepare for upcoming round 1 of GCJ 2021. Contest link: codingcompetitions.withgoogle.com/codejam/round/000000000019fef4 0:00 Intro 1:31 A. Overexcited Fan 9:58 B. Overrandomized 24:07 C. Oversized Pancakes 33:00 coding Test Set 1 (D = 3) 37:23 solving Test Set 2 46:47 coding Test Set 2 52:42 submit & summary Coding live streams - www.twitch.tv...
LCA - Lowest Common Ancestor
zhlédnutí 57KPřed 3 lety
Tutorial on LCA algorithm. We use Binary Lifting to get O(N*log(N)) preprocessing and O(log(N)) to find the lowest common ancestor of two nodes in a tree. Binary Lifting video czcams.com/video/oib-XsjFa-M/video.html SPOJ problem www.spoj.com/problems/LCASQ/ code github.com/Errichto/youtube/blob/master/lca.cpp Two homework problems: 1) Answer queries "find distance between two given nodes U and ...
Binary Lifting (Kth Ancestor of a Tree Node)
zhlédnutí 91KPřed 3 lety
Tutorial on binary lifting (also called jump pointers). We find k-th ancestor of a node in O(log(N)). Problem link leetcode.com/problems/kth-ancestor-of-a-tree-node/ Final code github.com/Errichto/youtube/blob/master/leetcode/1483-kth-ancestor.cpp Coding live streams - www.twitch.tv/errichto FAQ - github.com/Errichto/youtube/wiki/FAQ Subscribe for more educational videos on algorithms, coding i...
Google Code Jam 2021 Qualification Round Solutions & Live Commentary
zhlédnutí 54KPřed 3 lety
My screencast and commentary of GCJ 2021 Qualification Round. Problems and leaderboard: codingcompetitions.withgoogle.com/codejam/round/000000000043580a 0:00 A. Reversort 3:37 C. Reversort Engineering 12:40 B. Moons and umbrellas 17:55 D. Median Sort 1:26:18 E. Cheating Detection 1:55:37 Results, Summary Coding live streams - www.twitch.tv/errichto FAQ - github.com/Errichto/youtube/wiki/FAQ Sub...
Chinese Remainder Theorem, 2-minute Method
zhlédnutí 78KPřed 3 lety
A simple method for Chinese Remainder Theorem (solving system of congruences), without any modular inverse. Here's my code for Advent of Code day 13 github.com/Errichto/youtube/blob/master/AOC-2020/13-search/shuttle2.cpp 0:00 Example 1 2:02 In General 2:56 LCM 4:05 Big Example 7:31 Extra Understanding Subscribe for more educational videos on algorithms, coding interviews and competitive program...
Hardest Advent of Code 2020 Problem (day 20 Jigsaw, backtracking)
zhlédnutí 40KPřed 3 lety
Hardest Advent of Code 2020 Problem (day 20 Jigsaw, backtracking)
Facebook Hacker Cup 2020 Finals
zhlédnutí 88KPřed 3 lety
Facebook Hacker Cup 2020 Finals
Bot Tournament | CodinGame Fall Challenge 2020
zhlédnutí 54KPřed 3 lety
Bot Tournament | CodinGame Fall Challenge 2020
Yandex Cup Algo 2020 Finals - Screencast & Commentary
zhlédnutí 52KPřed 3 lety
Yandex Cup Algo 2020 Finals - Screencast & Commentary
2nd Place in Google Kickstart 2020 G with keyboard-cam and commentary
zhlédnutí 178KPřed 3 lety
2nd Place in Google Kickstart 2020 G with keyboard-cam and commentary
DFS With Slashes - Coding Interview Stream Highlights
zhlédnutí 26KPřed 3 lety
DFS With Slashes - Coding Interview Stream Highlights
Algo Talk: Railroads from Facebook Hacker Cup
zhlédnutí 23KPřed 3 lety
Algo Talk: Railroads from Facebook Hacker Cup
Facebook Hacker Cup 2020 R3 (I Got To Finals!)
zhlédnutí 586KPřed 3 lety
Facebook Hacker Cup 2020 R3 (I Got To Finals!)
Algo Talk with SecondThread: Parade
zhlédnutí 27KPřed 3 lety
Algo Talk with SecondThread: Parade
Facebook Hacker Cup 2020 R2 (7th place)
zhlédnutí 32KPřed 3 lety
Facebook Hacker Cup 2020 R2 (7th place)
Facebook Hacker Cup 2020 R1 (full score, part 2)
zhlédnutí 132KPřed 3 lety
Facebook Hacker Cup 2020 R1 (full score, part 2)
Facebook Hacker Cup 2020 R1 (full score, part 1)
zhlédnutí 77KPřed 3 lety
Facebook Hacker Cup 2020 R1 (full score, part 1)
Matrix Exponentiation Coding (Part 2/2, HARD)
zhlédnutí 32KPřed 3 lety
Matrix Exponentiation Coding (Part 2/2, HARD)
Facebook Hacker Cup 2020 Qual' (2nd place)
zhlédnutí 2,9MPřed 3 lety
Facebook Hacker Cup 2020 Qual' (2nd place)
Matrix Exponentiation Coding (Part 1/2)
zhlédnutí 35KPřed 3 lety
Matrix Exponentiation Coding (Part 1/2)

Komentáře

  • @thirilochan_karthi_m.s

    What happened to this guy is he still in Competitive programming

  • @user-dp3ri3fj1w
    @user-dp3ri3fj1w Před 7 dny

    nice

  • @Dex0z
    @Dex0z Před 7 dny

    This is him messing with computers since childhood, parents forced him through hard shooling math is essential for this type of programming

  • @IngCivil-vi9jr
    @IngCivil-vi9jr Před 11 dny

    more videoss please

  • @RahulBansal14
    @RahulBansal14 Před 12 dny

    I used to waste a lot of time while solving a problem. I will stay on the problem for 1 day that was huge waste. This is a good advice think for about 20 minutes.

  • @luizeduardoreis7657
    @luizeduardoreis7657 Před 12 dny

    You are an amazing teacher

  • @madelineabio9406
    @madelineabio9406 Před 15 dny

    THANK YOU

  • @glad_asg
    @glad_asg Před 16 dny

    hey, ty for this video <3

  • @cya3mdirl158
    @cya3mdirl158 Před 16 dny

    A wiesz jak zaprojektować duży system z użyciem DDD?

  • @pythonsamurai
    @pythonsamurai Před 18 dny

    Да говори нормально, все свои

  • @hafiz031
    @hafiz031 Před 18 dny

    Can taking modulo M ensure the program would have produced correct results if we didn't take the modulo? As taking modulo with M will only produce results in [0, M-1] range. So, there might be some case, where two implementations (one is correct, and another is wrong) of the same problem might give the same results when we take the modulo and can bypass the test cases.

  • @user-pv7zx6yn9u
    @user-pv7zx6yn9u Před 19 dny

    Love this video

  • @Haphazard1945
    @Haphazard1945 Před 20 dny

    I've been writing software for years and haven't interviewed in about 10. This is never used on the job so why is it tested for during interviews? Wouldn't system design make much more sense?

  • @LearnWithAnmolll
    @LearnWithAnmolll Před 21 dnem

    your article is just awesome

  • @olayinkaanifowose5099

    first time seeing this, proud of myself that i was able to come up with the alternative prefix sum algorithm within minutes. Never heard of kadane's algorithm before.

  • @pankajvermacr7
    @pankajvermacr7 Před 29 dny

    Can any one help me how can i apply binary search here ? An image is represented by a binary matrix with 0 as a white pixel and 1 as a black pixel. The black pixels are connected, i.e., there is only one black region. Pixels are connected horizontally and vertically. Given the location (x, y) of one of the black pixels, return the area of the smallest (axis-aligned) rectangle that encloses all black pixels. [ [0,1,0,1,0] [0,1,0,1,0], [1,1,0,1,0], [0,1,1,1,0] ] output = 16

  • @debjit811
    @debjit811 Před měsícem

    The last problem "Count Coin change" can be solved in a much simpler way using 1D array: dp[0] = 1; for x in nums: for i from (1 to x): dp[ i ] += dp[ i - x ]; print dp[x]

  • @sahilamin219
    @sahilamin219 Před měsícem

    This video is What i have WAITED to see for YEARS . You are FIRE 🔥

  • @agustinperez8700
    @agustinperez8700 Před měsícem

    I like more the first one, for me it's the most important, just PRACTICE.

  • @LB-qr7nv
    @LB-qr7nv Před měsícem

    I thought about the fake-number-solution before. Why do we need to use -1? Just use any number not in the array, for example max(array)+1

  • @rachitsingh2013
    @rachitsingh2013 Před měsícem

    You should explain your code with a working example

  • @aziz0x00
    @aziz0x00 Před měsícem

    Thank you so so so much <3 <3

  • @Ass4Days
    @Ass4Days Před měsícem

    What language is he coding in?

  • @Vadleer
    @Vadleer Před měsícem

    I’m studying Python, thank you sir Jer salute🫡

  • @anowlwithinternet9125
    @anowlwithinternet9125 Před měsícem

    You never dissappoint!

  • @Rudra0x01
    @Rudra0x01 Před měsícem

    His chair left him to be red coder at the end

  • @wew8820
    @wew8820 Před měsícem

    this guy learned english, and computer science and how to explain things clearly and put it all on youtube for free so us dumb people can learn, what a legend

  • @sirrus3009
    @sirrus3009 Před měsícem

    And my Amazon phone screen interviewer wanted me to do this in 20 mins.

  • @MyKneeHurts
    @MyKneeHurts Před měsícem

    I have no math background. Can i still do this?

  • @kartiknagrale1479
    @kartiknagrale1479 Před měsícem

    Wow I just watched it on the 1st of April

  • @48_subhambanerjee22
    @48_subhambanerjee22 Před měsícem

    If someone has filename a.cpp... it means they are ☠️☠️💀

  • @davithov
    @davithov Před měsícem

    You're an amazing competitive programmer, but probably you should learn the c++ language a bit. For example, it was surprising to me that you didn't know about local variable's lilfetime and that it is an issue to return reference to it as it is already destroyed.

  • @aiman_yt
    @aiman_yt Před měsícem

    I'm convinced Errichto was sent by God

  • @0xCP
    @0xCP Před měsícem

    Great explanation! can you provide more problems to practice after each tutorial please? or in general what should one do after watching a tutorial like this? keep solving on the same topic or just solve problems in general? thanks a lot!

  • @CHRISTO_1001
    @CHRISTO_1001 Před měsícem

    👩🏼‍❤️‍💋‍👨🏼🇮🇳🇮🇳🥥🥥🚠🚠🥇👩🏻‍❤️‍👨🏻💝💝🙏🏻🏠🏠👨‍👩‍👧👰🏻‍♀️🏏🏠🏠🏠

  • @CHRISTO_1001
    @CHRISTO_1001 Před měsícem

    👨🏻‍🎓🥇🥇🗝️🗝️💝👰🏻‍♀️😄🥥🏠👨‍👩‍👧🕊️🥥👰🏻‍♀️💝🥇🥇🚠

  • @035asadali8
    @035asadali8 Před měsícem

    where are you bro i even forget you exist

  • @bieniumyszkowski8252
    @bieniumyszkowski8252 Před měsícem

    What if I just want to stuck for Long hours?

  • @mahindrakatta2957
    @mahindrakatta2957 Před měsícem

    what if the question asks the maximum rectangle possible?

  • @AbjSir
    @AbjSir Před měsícem

    Dimension of dp is the number of variables which can completely define a state

  • @AbjSir
    @AbjSir Před měsícem

    dp is used to save time which gets wasted into doing repeated work Generally this happens when one state depends on more than one state

  • @supernovic99
    @supernovic99 Před 2 měsíci

    I like solving cs problems but this overwhelmed me

  • @johnvanschultz2297
    @johnvanschultz2297 Před 2 měsíci

    My man didn't even bother running the tests he went right to submit. I will never be that brave

  • @tbrjrbddo
    @tbrjrbddo Před 2 měsíci

    We love Errichto..he is the best!

  • @JarppaGuru
    @JarppaGuru Před 2 měsíci

    we can find nth fibonacci same fast than nth prime, but we can get is this prime faster than is this fibonacci LOL

  • @freddyhaug9379
    @freddyhaug9379 Před 2 měsíci

    Prefix sum really sizzled my brain two years into leetcoding. Phew!

  • @JarppaGuru
    @JarppaGuru Před 2 měsíci

    5:29 yes bcoz you moved and it did something else. now it do same thing. and we not use % we use math,fom() its better

  • @sauravkumarjha2838
    @sauravkumarjha2838 Před 2 měsíci

    (ans-1+mod)%mod is important instead of simply ans-1 .. I couldn't figure it out myself.. for problem S-Digit Sum

  • @sauravkumarjha2838
    @sauravkumarjha2838 Před 2 měsíci

    Thanks Errichto! solving first four was really good ;)

  • @anshulyadav269
    @anshulyadav269 Před 2 měsíci

    how many here have attended interviews at FANG (Facebook,Amazon, Netflix,Google)companies and got DP questions in their processes ?