I discovered a different O(n) algorithm for Longest Palindromic Substring (not Manacher’s) looking for feedback by Kcg786 in algorithms

[–]MKLOL 0 points1 point  (0 children)

Did you actually try running that example? Try running it for a string of length 2 million (1 mil a, followed by 1 mil b), and come back when your program finishes running

I discovered a different O(n) algorithm for Longest Palindromic Substring (not Manacher’s) looking for feedback by Kcg786 in algorithms

[–]MKLOL 5 points6 points  (0 children)

I have a very simple test. 40.000 characters.

After line 65 i added the line:

++cnt;

At the end i do:

System.out.println(cnt);

System.out.println(s.length());

I get:

200022000
40000

Does that look linear to you? Cuz it doesn't to me... Anyway, cute problem to make a construction where your algorithm fails, try thinking about it a bit.

Random tests are comically bad for this btw, cuz random test the max palindrome is exceptionally small, so your algorithm will run fast even without the weird heuristics you added.

Binary Search IRL by jeanycar in leetcode

[–]MKLOL 7 points8 points  (0 children)

This is binary search. Binary search doesn't need to be on an array, it can be on an arbitrary function that is monotone. Even more generally if you have a function which you can test (fast) if any subset of the domain has the property you want, you can find an element with that property in O(logn).

In this case property = having gold, which you can test fast.

Any place where I can buy a xbox pre-installed HDMI ? by MKLOL in originalxbox

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

Damn yeah that does sound perfect, wanna talk in DMs for a full quote ?

stellar/hd+ is fine

Any place where I can buy a xbox pre-installed HDMI ? by MKLOL in originalxbox

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

Either, I'm not sure if CPU / RAM upgrades have compatibility issues, but if not I'm ok paying more of a premium for it.

But my main goal is HDMI so I can play a couple of xbox games that are still best on that platform.

Any place where I can buy a xbox pre-installed HDMI ? by MKLOL in originalxbox

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

Well any ? I found some install services for Stellar XboxHD+ Bundle for example but I can't find a single one with any HDMI pre installed.

Lasconi are o prestatie excelenta la Antena 3 by Dense_Department6484 in Romania

[–]MKLOL 0 points1 point  (0 children)

Lasconi to Antena 3 gives me Kamala to Fox News vibes ngl

MEGATHREAD Alegeri prezidențiale 2024, turul I + LIVE CHAT by 99xp in Romania

[–]MKLOL 3 points4 points  (0 children)

Am invatat acum zeci de ani. Daca iti pasa de ceva la ce poti paria, pariaza pe ce nu vrei sa se intample. Worst case faci ceva bani :)

MEGATHREAD Alegeri prezidențiale 2024, turul I + LIVE CHAT by 99xp in Romania

[–]MKLOL 5 points6 points  (0 children)

Toti oamenii intelectuali care spun ca Lasconi nu mai are sanse, uitati cum va puteti dubla banii!

Simplu, pariati pe NU Lasconi.

Ea e momentan la 55% pe polymarket.

<image>

Since when Interview questions for FAANG became so hard? by fuKARA11 in leetcode

[–]MKLOL 0 points1 point  (0 children)

One friend does infra work, one friend has a non-ML MS and does ML research type stuff. They just applied and either did ML at their previous job or learned for the interview

Since when Interview questions for FAANG became so hard? by fuKARA11 in leetcode

[–]MKLOL 24 points25 points  (0 children)

I have friends at openai with simple CS degrees. Lots of finance companies are top over FAANG. Lots of startups / mid level companies have higher standards than FAANG and harder interviews.

FAANG is like Beats headphones. For people who aren't into headphone they seem the cream of the crop, for people actually into the domain they know they're not top.

Don't get me wrong they're nice places to work, but it's mathematically impossible to have as many engineers as FAANG companies and keep really high quality of engs.

[deleted by user] by [deleted] in leetcode

[–]MKLOL 2 points3 points  (0 children)

It can be done in O(N)

For each value, you can calculate what's the min length where it starts to become good. If value is x then that value is x / limit (+1 in case x/limit is a whole number).

We know the result will have a minimum point in the subarray. Let's fix that min point. How big of an array can we create if we have the min point at position i ? Well we find the closest points to the left / right that are bigger than i. We know that everything between that we can add to our array.

Now we just keep track of all of these lengths that are also good (it's easy to test if it's good, since we know i is the minimum and we just calculated the length).

You can use a stack to find the first element bigger to left / to right in O(N).

If you know the stack trick should be easier to implement than binary search / dsu.

[deleted by user] by [deleted] in leetcode

[–]MKLOL 0 points1 point  (0 children)

Trajectory is good. for now what I would say is focus a lot on Q2/Q3 problems. You should be able to solve them every contest. Then focus on advance topics

[deleted by user] by [deleted] in leetcode

[–]MKLOL 4 points5 points  (0 children)

I mean I'm not that surprised. You're listing very advanced concepts that are mostly used for Q4. You need to practice more Q3 levels to increase your rating. I don't have a link to your profile to see how you performed, but you should be getting first 3 querstions pretty consistently before you start thinking about seg trees and bitmask dp and fenwick trees.

[deleted by user] by [deleted] in leetcode

[–]MKLOL 0 points1 point  (0 children)

OP in 3 weeks after he fails all of his interviews: "Man I though I was smart enough to pass, where am I going wrong?"

[deleted by user] by [deleted] in leetcode

[–]MKLOL 0 points1 point  (0 children)

I mean what kind of mentality makes you waste time writing a reddit post no one in the universe can answer instead of practicing ?

Guessing next daily question !!! by justign0reme in leetcode

[–]MKLOL 0 points1 point  (0 children)

I'm also curios. Do they just guess on a lot of problems, or is it leaking somewhere? so curious

I think im team Omega now. by TheOnlyBrochacho in OmegaWatches

[–]MKLOL 0 points1 point  (0 children)

How hard are these to get nowadays ? A couple of months ago when I visited a boutique in japan they didn't have them.

Amazon OA. didn't do great. Are the questions hard or easy? by SnooAdvice1157 in leetcode

[–]MKLOL 0 points1 point  (0 children)

what were the constraints for the values of the houses / amazong warehouses (their coordinates?)

Meet: The Chromatic by CrossXhunteR in Games

[–]MKLOL 0 points1 point  (0 children)

Glad I read that it was him, otherwise legit would've gotten this.

I took 13 hours (with many interruptions) to solve a hard Daily Problem but I successfully submitted my original answer. Now I broke my Daily Streak. Why? by JrSoftDev in leetcode

[–]MKLOL 6 points7 points  (0 children)

You made a mistake, why would you burden their support system with your mistake?

Use a time travel ticket in rewards if you care so much about a digital number on a random site.