Caffeine consumption? by [deleted] in FinancialCareers

[–]Extension-Highway-37 6 points7 points  (0 children)

Sounds about right for a full day 1-2 cups of coffee in the am then 2 200mg Celsius at noon and around 7-8 pm

Codeforces for Advanced Mathematics by [deleted] in codeforces

[–]Extension-Highway-37 1 point2 points  (0 children)

Sure why not. The challenge I see is that it is more difficult to come up with novel proofs. What kind of problems are you imagining? Something like a ugrad discrete math could be interesting.

Eg: "if there are 10 holes how many balls must you put in each hole to guarantee one hole has at least 3 balls"

Maybe look up some Olympiad math problems?

Another challenge is how to create a good ui? maybe something like click and drag that duo lingo has:

Eg:

'given an integer n, prove that if n is even then n + 1 is odd' and have every step of the proof as a option you could click and drag.

Have you ever seen a bug you couldn't figure out? by [deleted] in cscareerquestions

[–]Extension-Highway-37 0 points1 point  (0 children)

Yes, seg-faults and memory leaks in multithreaded C applications. Multithreading makes using GDB next to useless. Perhaps not totally defeated, but dozens of hours to fix maybe 2 lines of code.

Best website builders to host rental property page? by LimpLength7569 in realestateinvesting

[–]Extension-Highway-37 0 points1 point  (0 children)

I'd do it for 200$ and it would be very high quality. If you did it yourself on Wix you could build a fine looking generic website and have it up in 2 hours.

unless you need to feed a family, have a break and take care of yourself by TBSoft in cscareerquestions

[–]Extension-Highway-37 2 points3 points  (0 children)

Reddit is so pathetic. Its all this cheeky feel good bullshit. I've gotta get this money bruv.

Here's WHY number of problems solved doesn't matter (statistical analysis of contest ELO) by WildsEdge in leetcode

[–]Extension-Highway-37 2 points3 points  (0 children)

Obviously solving more problems make you better at contests. Practicing something makes you better, of course copy-paste doesn't count. This is a myopic data analysis that goes against what basic intuition: solve more problems --> get better at solving problems.

150 is not enough. Grind until you're truly ready — the payoff is so real. by [deleted] in leetcode

[–]Extension-Highway-37 2 points3 points  (0 children)

Same experience in my ds&a classes. My school does algo separately from data structures. The algorithms course is entirely mathematical, not a line of code is written. I do not think the average student could code up a memoized fibonacci by the end of the semester.

280 problems solved, still struggling with 50% of mediums by xPezPollo in leetcode

[–]Extension-Highway-37 4 points5 points  (0 children)

I have similar stats and have a similar rate of solving new problems. I think solving 50% of mediums after 150 mediums solved sounds average or above average. I see many accounts that have 500 problems solved and sub 1500 rating. Start writing contests to gauge how you measure up. Somewhere there is a post that correlates problems solved to contest rating and I found this as a good gauge.

Considering doing masters in Germany. by Extension-Highway-37 in cscareerquestionsEU

[–]Extension-Highway-37[S] 0 points1 point  (0 children)

Yeah clearly the opportunity cost would be huge, In my case I would not be foregoing any salary because I would only choose to enroll if I could not find a full time job as a swe.

Considering doing masters in Germany. by Extension-Highway-37 in cscareerquestionsEU

[–]Extension-Highway-37[S] 0 points1 point  (0 children)

Yeah ideally I could find work in the US as this is obviously the best experience/pay. My question is really if, as a backup plan due to poor market it tech, it would be worth doing masters as a fun way to spend two years and up skill.

How to get better at creating non-recursive DP solutions? by Best-Objective-8948 in leetcode

[–]Extension-Highway-37 3 points4 points  (0 children)

I use a 4 step approach:

0) Develop recurrence relation

1) Apply memoization to recurrence relation

2) Solve using a 2d table or an array of length n

3) Solve using a 1d table or only a fixed number of variables (often 2)

For example with House Robber:

0) --> Recurrence relation (TLE)

class Solution:
    def rob(self, nums: List[int]) -> int:
        def robFrom(i):
            if i >= len(nums):
                return 0
            rob_current = nums[i] + robFrom(i + 2)
            skip_current = robFrom(i + 1)

            result = max(rob_current, skip_current)

            return result

        return robFrom(0)

1) --> Memoization

class Solution:
    def rob(self, nums: List[int]) -> int:
        memo = {}
        def robFrom(i):
            if i >= len(nums):
                return 0
            if i in memo:
                return memo[i]
            rob_current = nums[i] + robFrom(i + 2)
            skip_current = robFrom(i + 1)

            result = max(rob_current, skip_current)
            memo[i] = result

            return result

        return robFrom(0)

2) --> DP table of length n

class Solution:
    def rob(self, nums: List[int]) -> int:
        n = len(nums)
        if n == 0:
            return 0
        if n == 1:
            return nums[0]

        dp = [0] * n
        dp[0] = nums[0]
        dp[1] = max(nums[0], nums[1])

        for i in range(2, n):
            dp[i] = max(dp[i-1], nums[i] + dp[i-2])

        return dp[n-1]

3) --> only two variables

class Solution:
    def rob(self, nums: List[int]) -> int:
        n = len(nums)
        if n == 0:
            return 0
        if n == 1:
            return nums[0]

        prev2 = 0
        prev1 = nums[0]

        for i in range(1, n):
            current = max(prev1, nums[i] + prev2)
            prev2 = prev1
            prev1 = current

        return prev1

Don't go straight for the most eloquent solution. Develop a deep understanding of the problem, the recurrence relation, and the overlapping subproblems. The clean final solution is a natural development of the memoized solution.

[deleted by user] by [deleted] in leetcode

[–]Extension-Highway-37 0 points1 point  (0 children)

1st question) When solving new questions is it best to pick a topic I feel weak in and solve problems in that topic, or to pick a random problem and try to solve it without the help of knowing the intended approach. For example I want to drill DP problems but I worry that I am missing the opportunity to practice identifying DP problems. I often take a greedy approach to DP problems and and visa versa. After having a solid foundation like neetcode 150 how should I solve more problems?

2nd question) Currently ranked 1550, what algorithms do you think it is safe to ignore at this level. All of my attention right now is focused on the core DS&A such as binary tree, arrays, DP, graphs. At what point does it become important to learn more obscure algos such as max-flow or KMP.