We can't always choose our starting point.
But we can keep learning from where we are and make better decisions about our next step.
Life is a continuous optimization problem.
And every day gives us another chance to update our parameters.
#LearningInPublic#MachineLearning
I was learning Gradient Descent in Machine Learning when I realized something unexpected…
Maybe we're all just trying to minimize the loss in our lives.
So maybe the real lesson is this:
You don't need to have everything figured out today.
Learn something.
Take a small step.
Observe the result.
Adjust your approach.
Repeat.
Progress doesn't always look impressive, but it compounds.
I resigned from Anthropic today. I spent the last three years doing pretraining research at both OpenAI and Anthropic. Neither company is acting responsibly. They are racing straight to self-improving superintelligence and gambling with our lives. More thoughts below.
The final solution runs in O(n²) time.
But the complexity wasn't the part I found most useful.
The real takeaway:
A difficult problem can become much simpler when you change how you look at it.
3Sum → Fix one → 2Sum → Two pointers.
#DSA#LeetCode#LearningInPublic#CSE
Today I worked on 3Sum.
Initially, I was looking it as a problem where I had to find 3 numbers whose sum=0
But after sorting the array, started thinking differently:
What if I fix one number and turn 3Sum->2Sum?
That made the problem much easier to reason about.
The two-pointer approach then started making sense naturally.
If the current sum is too small, I need a larger value.
If it's too large,need a smaller val.
Since the array is sorted, pointers tell me exactly which direction to move.
I also had to think carefully about duplicates.
The biggest improvement wasn't going from 65 lines → 15 lines.
It was understanding why those 15 lines work.
That's what I'm trying to focus on while learning DSA:
Solve → Understand → Optimize → Repeat
Day 2. Still a long way to go.
#DSA#LeetCode#LearningInPublic#CSE
🧵 Day 2 of learning DSA
Yesterday, I solved Sorted Squares with my own approach.
It worked in O(n), but the code was around 65 lines.
Today, I went back to the same problem.
And reduced it to ~19 lines.
The optimized approach:
→ left points to the beginning
→ right points to the end
→ Compare abs(nums[left]) and abs(nums[right])
→ Put the larger square at the end of the result
→ Move the corresponding pointer
Time: O(n)
Extra space: O(1) apart from the output array