kaushalml.hashnode.devFrom Zero to Gradient Descent: A Deep Dive into Simple Linear RegressionMachine Learning often feels intimidating. Neural networks. Transformers. LLMs. Diffusion models. But behind all of them lies something surprisingly simple: Optimization. And the best place to underst1d ago·5 min read
kaushalm.hashnode.devTop K Frequent Elements — When HashMaps Start Earning Their SalaryGiven an integer array nums and an integer k, return the k most frequent elements within the array. The test cases are generated such that the answer is always unique. Example 1: Input: nums = [1,2,2,1d ago·2 min read
kaushalm.hashnode.devScoring a String: Or How I Accidentally Did ASCII Math AgainEver looked at a string and thought: “Yes, today I will subtract characters from each other.” No?Well, LeetCode did. Today’s problem is deceptively simple, which makes it dangerous — because you either: overthink it, or feel suspicious about how ...Jan 21·2 min read
kaushalm.hashnode.dev"Intersection of Two Linked Lists": The Elegant Two-Pointer Solution (Java)Hello everyone! Today, we're tackling a popular linked list problem: "Intersection of Two Linked Lists" (LeetCode #160). The challenge is to find the exact node where two singly linked lists merge or "intersect." While it might seem tricky due to var...Jun 5, 2025·4 min read
kaushalm.hashnode.dev"Linked List Cycle": Detecting Loops with Floyd's Tortoise and Hare Algorithm (Java)Hello everyone! Today, we're diving into a classic linked list challenge: "Linked List Cycle" (LeetCode #141). The task is simple: determine if a given linked list contains a cycle. The clever solution for this problem is a testament to pointer manip...Jun 5, 2025·4 min read