Rikam Palkar background image
Author
Rikam Palkar
.NET Full Stack, DSA, C#, React, Blazor, WPF, JavaScript
Mumbai (India)
Recognitions & awards
    • Jun 2020
    • Jun 2021
    • Jun 2022
    • Jun 2023
    • Jun 2024
    • Jun 2025
Badges
Awards & Certifications
  • MCA
    VJTI
About

"Microsoft MVP", Five-time "C# Corner MVP", "Verified author" on Medium "Top voice" on LinkedIn, Author behind 'WPF Simplified' and 'Blazor Simplified'.I'm passionate about making the world a better place by writing scalable, efficient code, I'm skilled at Blazor, WPF, C#, and Data Structures & Algorithms.

Activity
Re: Angular vs React with .NET in 2025 – Which Should I Learn?

Re: Angular vs React with .NET in 2025 – Which Should I Learn?

You’re Using useState for That? Cute

You’re Using useState for That? Cute

2w 454 0

Bob here changed one digit & suddenly became richer than Elon.

#Algorithm
To get the max number: First digit has to be 9, loop till you find digit is < 9 then replace all occurrences of that first digit with 9.
To get the min number: Same as first step, here first digit has to be 1
Return: max - min.

#GitHub:
https://github.com/RikamPalkar/DSA-Simplified/blob/main/LeetCode/2566. Maximum Difference by Remapping a Digit.cs

#Algorihm #Coding #Programming

Image previewImage preview

Tried Greedy with 2 sorts, didn’t Cut It hence Binary Search!

#Algorithm
- Sort the Array
-- So we can try to pair close numbers and minimize the differences.

- Binary Search
- The smallest possible max difference is 0, the largest is max(nums) - min(nums).
- Guess a Difference (mid) and Try It
- Check if We Can Form p Pairs where mid <= p
-- If yes, try a smaller mid. If no, try a bigger one.

- When l == r, you've found the smallest max difference that allows p pairs.

Image previewImage preview

Its easy problem today guys

Image previewImage preview
Wrapper Component to Consumer Component: That’s a Wrap!

Wrapper Component to Consumer Component: That’s a Wrap!

3w 548 0

DFS and Maths should never be combined!

#Algorithm
- DFS numbers 1 to 9
- Base condition: If the current number exceeds n, stop recursion.
- Else add the current number to the result list.
Multiply the number by 10 to get to the next level (1 - 10, 10 - 19, 100 - 109).
- For the deeper level:
-- If the next level starting number exceeds n, return.
-- Else, recurse for each number in the range [curr number, curr number, + 9].

Image previewImage preview

Thought of Queue first! Stack approach was easy for edge cases!
#Algorithm
- 26 stacks: one for each letter ('a' to 'z'), to store the indices of those characters.
- Loop input string: Convert the input string into a character array for updates.
- For each character:
-- If it’s a letter, push its index onto the stack corresponding to that letter.
-- If it’s a *, find the smallest letter stack (from 'a' to 'z') that is not empty, pop its top index, and mark that character as '0' - placeholder

Image previewImage preview

It seems like robots and AI are taking over everything these days!

#Algorithm
- Count the frequency of each character in s.
- Use a stack to hold letters as you process s from left to right.
- Track the smallest character from current index to end of s.
- At each step, move the current letter to the stack and update frequency.
- Pop from the stack to the result whenever the top of the stack is ≤ the smallest left character.

Code:
https://lnkd.in/ebraFu_M

#DSA

Image previewImage preview
useRef: The React Hook You’re Sleeping On

useRef: The React Hook You’re Sleeping On

3w 632 0

DSU Was Right There, But Not in My Head

Disjoint Set Algorithm!


#Algorithm

- Convert each char to num and form DSU of both strings

- When Union, always choose the smaller character as the group’s parent to ensure the smallest lexicographical representative.

- Return parent of each node


#Code:
https://github.com/RikamPalkar/DSA-Simplified/blob/main/LeetCode/1061. Lexicographically Smallest Equivalent String.cs


#DSA #Programming #Leetcode


Image previewImage preview
Understanding useState in React

Understanding useState in React

4w 616 0

Who Hid the Candies, deep down the graph?


#Algorithm

- Process boxes in the order you discover them, so BFS hence queue

- If a box is unopened and can be opened (status == 1), open it, collect candies, and mark it as opened.

- Add all the contained boxes and newly unlocked keys to your queue, update their status = 1.

- Repeat until there are no more boxes in the queue.

Image previewImage preview
Post Jun 03

After a Bunch of Trial and Error!

#Leetcode 135


#Algorithm:

1 - left-to-right pass:

If the next child’s rating is higher, they get 1 more candy than the previous.

2 - Do a right-to-left pass:

If the previous child’s rating is higher, ensure they have at least 1 more candy than the next child.

3. Sum up the candies.


#Code:
https://github.com/RikamPalkar/DSA-Simplified/blob/main/LeetCode/135. Candy.cs


#DSA #Programming

Image previewImage preview
Post Jun 02
 React Children! Yeah, That’s What They Called

React Children! Yeah, That’s What They Called

Jun 01 719 2

As a kid, Snakes and Ladders was fun, didn’t realize I’d be coding the shortest path for it one day!

#Algorithm:
1. BFS hence Queue, add 1 to begin with.
2. For each move, simulate all 6-sided dice rolls (loop from 1 => 6).
3. Use Helper method to map square numbers to (row, col) on the board.
4. If there’s a snake or ladder (board[row][col] != -1), jump to that destination square.
5. Track visited squares and increment steps at each BFS level.

Image previewImage preview
Post May 31
 Interfaces vs Types in TypeScript

Interfaces vs Types in TypeScript

May 29 563 0

Math > Loop

Time, Space: O(1)

#Algorithm

1. Add all numbers from 1 to n

- Use formula: totalSum = n × (n + 1) / 2


2. Add all numbers from 1 to n that are divisible by m

- Count how many: count = n / m

- Then: divisibleSum = m × count × (count + 1) / 2


3. Return nonDivisibleSum - divisibleSum


#Code:
https://github.com/RikamPalkar/DSA-Simplified/blob/main/LeetCode/2894. Divisible and Non-divisible Sums Difference.cs


#Programming #DSA

Image previewImage preview
Post May 27
How to Pass Functions & Params in React + TypeScript

How to Pass Functions & Params in React + TypeScript

May 27 521 0
One Cool Trick in React: Memo

One Cool Trick in React: Memo

May 26 514 0
Suggested learning
View all