#leetcode

Read more stories on Hashnode

Articles with this tag

Intuition Get the length of the subsequence (if any) and subtract it from the length of t to find out how many characters we have to append (if...

Intuition Sort the array and check if the start and end of the array match. If not, increment or decrement accordingly. Approach First sort the array....

Intuition Find position of ch (if any) then use two pointers to swap characters until string is reveresed from beginning to index of ch Approach Start...

Intuition Use two pointers to iterate through the string checking each adjacent character to see if it is "bad" or "good". Approach First if the...

Intuition Since both arrays are sorted, we can find the minimum common value by iterating from left to right with two pointers. Approach Initialize...

Approach First check to make sure there's enough elements in the original matrix to meet the new row and column requirements. I did this by creating a...