xkeycode21's profile picture. SDE@Amazon | Loves Linux | Building things, breaking them and learning along the way.

Parth Rathod

@xkeycode21

SDE@Amazon | Loves Linux | Building things, breaking them and learning along the way.

Pinned

Career update:- Joined Amazon as SDE-1 I have been grinding for the past 1.5 years while working full time job/ freelancing on the side. Tough but definitely doable and grateful for the people who’ve supported me. I wish everyone a Happy and Blessed Rakshabandhan!

xkeycode21's tweet image. Career update:- Joined Amazon as SDE-1 

I have been grinding for the past 1.5 years while working full time job/ freelancing on the side. Tough but definitely doable and grateful for the people who’ve supported me. 

I wish everyone a Happy and Blessed Rakshabandhan!
xkeycode21's tweet image. Career update:- Joined Amazon as SDE-1 

I have been grinding for the past 1.5 years while working full time job/ freelancing on the side. Tough but definitely doable and grateful for the people who’ve supported me. 

I wish everyone a Happy and Blessed Rakshabandhan!
xkeycode21's tweet image. Career update:- Joined Amazon as SDE-1 

I have been grinding for the past 1.5 years while working full time job/ freelancing on the side. Tough but definitely doable and grateful for the people who’ve supported me. 

I wish everyone a Happy and Blessed Rakshabandhan!

11/10/25 @LeetCode POTD we have option for every index to pick or not pick it. To not check the previous -1, and -2 we sort the array and use recursion to skip forward steps in this way we take care of the not_take element's prev vals. Use freq map to count all the occurrences.

xkeycode21's tweet image. 11/10/25 @LeetCode POTD
we have option for every index to pick or not pick it. To not check the previous -1, and -2 we sort the array and use recursion to skip forward steps in this way we take care of the not_take element's prev vals. Use freq map to count all the occurrences.

Hey everyone busy with work and also broke my 385 day streak sucks :( 10/10/25 @LeetCode POTD Think about it in bottom up dp. from n-k to n-1 we will exceed n's boundary from n-k-1 to 0 we can simply add the val at i+k to get the final res iterate through the ans arr to get max

xkeycode21's tweet image. Hey everyone busy with work and also broke my 385 day streak sucks :(
10/10/25 @LeetCode POTD
Think about it in bottom up dp. 
from n-k to n-1 we will exceed n's boundary
from n-k-1 to 0 we can simply add the val at i+k to get the final res
iterate through the ans arr to get max

01/10/25 @LeetCode POTD Simulate the process. #DSA #Coding

xkeycode21's tweet image. 01/10/25 @LeetCode POTD
Simulate the process.
#DSA #Coding

30/09/25 @LeetCode POTD On trying we find that the problem boils down to MCM pattern. Too tired and hence did not solve it bottom up. TC-O(n^3) SC-O(n^2) #DSA #Coding

xkeycode21's tweet image. 30/09/25 @LeetCode POTD
On trying we find that the problem boils down to MCM pattern. Too tired and hence did not solve it bottom up.
TC-O(n^3)
SC-O(n^2)
#DSA #Coding

28/09/25 @LeetCode POTD Sort and check for valid triangle condition for 3 consecutive pairs. TC-O(nlogn) #DSA #coding

xkeycode21's tweet image. 28/09/25 @LeetCode POTD
Sort and check for valid triangle condition for 3 consecutive pairs. 
TC-O(nlogn)
#DSA #coding

27/09/25 @LeetCode POTD Did not knew about shoelace formula so I used heron's. attaching both solutions below #LeetCode #coding #DSA

xkeycode21's tweet image. 27/09/25 @LeetCode POTD
Did not knew about shoelace formula so I used heron's. 
attaching both solutions below
#LeetCode #coding #DSA
xkeycode21's tweet image. 27/09/25 @LeetCode POTD
Did not knew about shoelace formula so I used heron's. 
attaching both solutions below
#LeetCode #coding #DSA
xkeycode21's tweet image. 27/09/25 @LeetCode POTD
Did not knew about shoelace formula so I used heron's. 
attaching both solutions below
#LeetCode #coding #DSA

25/09/25 @LeetCode POTD Doing dp after a long time. Explore all paths and take minimum. Space opt is we only need the next state so just keep track of that. TC-O(n^2 + n) SC-O(n) #CodingJourney #DSA #LeetCode

xkeycode21's tweet image. 25/09/25 @LeetCode POTD
Doing dp after a long time. Explore all paths and take minimum. Space opt is we only need the next state so just keep track of that. 
TC-O(n^2 + n) SC-O(n)
#CodingJourney #DSA #LeetCode

25/09/25 @LeetCode POTD simulate the long division method.

xkeycode21's tweet image. 25/09/25 @LeetCode POTD
simulate the long division method.

23/09/25 @LeetCode POTD Capture the val after '.' and compare make sure to move the indexes properly. TC-O(n) SC-O(1) #LeetCode #CodingJourney

xkeycode21's tweet image. 23/09/25 @LeetCode POTD
Capture the val after '.' and compare make sure to move the indexes properly. 
TC-O(n) SC-O(1)
#LeetCode #CodingJourney

22/09/25 @LeetCode POTD Missed the design problems :( Simply count how the number of diff numbers with max_freq. We multiple them to get the final ans. TC-O(n) SC-O(n)

xkeycode21's tweet image. 22/09/25 @LeetCode POTD
Missed the design problems :(
Simply count how the number of diff numbers with max_freq. We multiple them to get the final ans. 
TC-O(n) SC-O(n)

21/09/25 @LeetCode POTD Keep unrented map of move to set of price,shop. Another rented set to store Price, Shop, movie list. We miss here a way to get price based on shop and movie so we build one. Operations are straightforward and logarithmic. #LeetCode #coding

xkeycode21's tweet image. 21/09/25 @LeetCode POTD
Keep unrented map of move to set of price,shop. Another rented set to store Price, Shop, movie list. We miss here a way to get price based on shop and movie so we build one. Operations are straightforward and logarithmic. 
#LeetCode  #coding
xkeycode21's tweet image. 21/09/25 @LeetCode POTD
Keep unrented map of move to set of price,shop. Another rented set to store Price, Shop, movie list. We miss here a way to get price based on shop and movie so we build one. Operations are straightforward and logarithmic. 
#LeetCode  #coding

19/09/25 @LeetCode POTD nfo required is cell's value which we can store using map. set and reset becomes trivial. After looking at solutions for get it would've been the best to split and extract instead of getting both values in one go like I did. Simpler version attached too

xkeycode21's tweet image. 19/09/25 @LeetCode POTD
nfo required is cell's value which we can store using map. set and reset becomes trivial. After looking at solutions for get it would've been the best to split and extract instead of getting both values in one go like I did. Simpler version attached too
xkeycode21's tweet image. 19/09/25 @LeetCode POTD
nfo required is cell's value which we can store using map. set and reset becomes trivial. After looking at solutions for get it would've been the best to split and extract instead of getting both values in one go like I did. Simpler version attached too
xkeycode21's tweet image. 19/09/25 @LeetCode POTD
nfo required is cell's value which we can store using map. set and reset becomes trivial. After looking at solutions for get it would've been the best to split and extract instead of getting both values in one go like I did. Simpler version attached too
xkeycode21's tweet image. 19/09/25 @LeetCode POTD
nfo required is cell's value which we can store using map. set and reset becomes trivial. After looking at solutions for get it would've been the best to split and extract instead of getting both values in one go like I did. Simpler version attached too

18/09/25 @LeetCode POTD Today is 366 day streak, yay! set/pq for storing best pair result. I used yesterday's conecept of Vlad of putting neg values in set so they come earlier. Another for priority, and one for userId can be combined but too lazy. TC-O(nlogn)

xkeycode21's tweet image. 18/09/25 @LeetCode POTD
Today is 366 day streak, yay!
set/pq for storing best pair result. I used yesterday's conecept of Vlad of putting neg values in set so they come earlier. Another for priority, and one for userId can be combined but too lazy.
TC-O(nlogn)
xkeycode21's tweet image. 18/09/25 @LeetCode POTD
Today is 366 day streak, yay!
set/pq for storing best pair result. I used yesterday's conecept of Vlad of putting neg values in set so they come earlier. Another for priority, and one for userId can be combined but too lazy.
TC-O(nlogn)

17/09/25 @LeetCode POTD Late to post because work has been hectic. store cuisine->set<rating, food>, food->rating, food->cuisine in maps. This way modification becomes logn and for highest we iterate from back find the smallest string and return. #dsa #Coding

xkeycode21's tweet image. 17/09/25 @LeetCode POTD
Late to post because work has been hectic. 
store cuisine-&amp;gt;set&amp;lt;rating, food&amp;gt;, food-&amp;gt;rating, food-&amp;gt;cuisine in maps. This way modification becomes logn and for highest we iterate from back find the smallest string and return.
#dsa #Coding
xkeycode21's tweet image. 17/09/25 @LeetCode POTD
Late to post because work has been hectic. 
store cuisine-&amp;gt;set&amp;lt;rating, food&amp;gt;, food-&amp;gt;rating, food-&amp;gt;cuisine in maps. This way modification becomes logn and for highest we iterate from back find the smallest string and return.
#dsa #Coding

15/09/25 @LeetCode POTD Store those chars which can't be used in a word. Used bitset for performance. Assume you can type the word unless a char mathes in that bitset set the flag to false. TC-O(n+m) SC-O(1) #DSA #LeetCode #CodingJourney

xkeycode21's tweet image. 15/09/25 @LeetCode POTD
Store those chars which can&apos;t be used in a word. Used bitset for performance. Assume you can type the word unless a char mathes in that bitset set the flag to false.
TC-O(n+m) SC-O(1)
#DSA #LeetCode #CodingJourney

14/09/25 @LeetCode POTD store exact match in mpp For case insensitive - convert KiTe becomes kite* if it is present then don't update it. For vowel preserve consonent order so replace vowels with _. KiTe becomes k_t_. use lowercase as only first match would be kept in map O(n*m)

xkeycode21's tweet image. 14/09/25 @LeetCode POTD
store exact match in mpp
For case insensitive - convert KiTe becomes kite* if it is present then don&apos;t update it.
For vowel  preserve consonent order so replace vowels with _. KiTe becomes k_t_. use lowercase as only first match would be kept in map
O(n*m)

United States Trends

Loading...

Something went wrong.


Something went wrong.