This is an easy level leetcode problem. Please refer to this link for the detail of the problem description. Basically, the idea is to find the longest consecutive 1’s and 0’s and return True if 1’s > 0’s. There are a couple of ways to achieve the problem. The first one is a pythonic way. READ MORE
Month: December 2021
Delete Characters to Make Fancy String
This is an easy level leetcode problem, which you can use stack to solve. Please refer to this link for more detail of the problem. Essentially, you cannot accept 3 or more consecutive duplicate letters. There could be many ways but using a stack seems to be the most elegant approach. Basically, you accumulate each READ MORE
Check Whether Two Strings are Almost Equivalent
This is a leetcode interview problem that requires a hash table with strings. Please refer to this link for more detail of the problem description. Let me first show you the solution code. A hash table is necessary in order to keep track of the frequencies of the letter in the word. Note that I READ MORE