yaox023
yaox023's blog

yaox023's blog

Follow
Follow
homenewsletter
Tag

leetcode

#leetcode

More content

Read more stories on Hashnode


Articles with this tag

Design Hit Counter

Feb 19, 20233 min read

In this article, let's tackle the leetcode Design Hit Counter. The problem is to design a hit counter, which counts the number of hits received in the...

Design Hit Counter

Candy Crush

Feb 18, 20234 min read

In this article, let's see how to solve the leetcode candy-crush problem. Candy crush is a popular game. The rules are very simple, just crush candies...

Candy Crush

Weighted Random

Sep 8, 20223 min read

Say we have an array and we want to get one element randomly. Instead of getting the element with equal probability, we want to specify the...

Weighted Random

The Euclidean Algorithm

Sep 7, 20222 min read

Let's first see a leetcode problem Find Greatest Common Divisor of Array. This problem is pretty easy. What we may do is to just calculate the max and...

The Euclidean Algorithm

Morris Traversal

Sep 5, 20224 min read

Inorder Traversal The problem is to do an inorder traversal. This is a pretty standard operation for tree structure. The most simple solution is to...

Morris Traversal

Fast Power Algorithm

Aug 11, 20222 min read

There is a leetcode problem Pow(x, n). Basically, it is a plain power function. We can follow the description and multiple number x with n...

Fast Power Algorithm