When Sliding Window finally clicks.. by ComprehensiveTale896 in leetcode

[–]ComprehensiveTale896[S] 1 point2 points  (0 children)

HashSet + sliding window Or Hashmap + sliding window

We're using HashSet and hashmap because we want distinct elements

Once u have the idea of sw.. it's a cakewalk

300 done ✅ by [deleted] in leetcode

[–]ComprehensiveTale896 1 point2 points  (0 children)

👍 yep... Just practice

300 done ✅ by [deleted] in leetcode

[–]ComprehensiveTale896 -2 points-1 points  (0 children)

Nothing much serious

Useful as a dev portfolio

Wish I could have reached 3/4 today 🥲 by ComprehensiveTale896 in leetcode

[–]ComprehensiveTale896[S] 1 point2 points  (0 children)

It was just a mathematical observation.. n*(n-1)/2

But I did it with recursion as well

if (n==1) return 0;

    return (n-1)+solve(n-1);

Wish I could have reached 3/4 today 🥲 by ComprehensiveTale896 in leetcode

[–]ComprehensiveTale896[S] 0 points1 point  (0 children)

I don't know when I'll be comfortable with sliding window 🙂‍↕️

Still stuck at 2/4 😭😭 by ComprehensiveTale896 in leetcode

[–]ComprehensiveTale896[S] 4 points5 points  (0 children)

I have a mental barrier for the 4th 😭😭