Meta Hacker Cup 2024 Participation Review

Read more
25th Place on Meta Hacker Cup

Read more
2nd Place on LC Contest

Three of my accounts recently achieved the #1, #2 and #3 leetcode ratings in South Korea. lol 😂

Leetcode contest speed-run global rank 2nd

Read more
53rd Place on Google Codejam Farewell Round

Read more
3rd Place on LC Contest

Leetcode contest speed-run global rank 3rd

Read more
40th Place on Google Kickstart

Read more
[LeetCode] Power Update After K-th Largest Insertion II

3930. Power Update After K-th Largest Insertion II

You are given an integer array nums and an integer p.

You are also given a 2D integer array queries, where each queries[i] = [val_i, k_i].

For each query:

  • Insert val_i into nums.
  • Let x be the k_i^th largest element in the current nums.
  • Update p to p^x % (10^9 + 7).

Return an array ans where the ans[i] represents the value of p after processing the i^th query.

Read more
[LeetCode] Subtree Removal Game with Fibonacci Tree

2005. Subtree Removal Game with Fibonacci Tree

A Fibonacci tree is a binary tree created using the order function order(n):

  • order(0) is the empty tree.
  • order(1) is a binary tree with only one node.
  • order(n) is a binary tree that consists of a root node with the left subtree as order(n - 2) and the right subtree as order(n - 1).

Alice and Bob are playing a game with a Fibonacci tree with Alice staring first. On each turn, a player selects a node and removes that node and its subtree. The player that is forced to delete root loses.

Given the integer n, return true if Alice wins the game or false if Bob wins, assuming both players play optimally.

A subtree of a binary tree tree is a tree that consists of a node in tree and all of this node’s descendants. The tree tree could also be considered as a subtree of itself.

Read more
[LeetCode] Valid Subarrays With Matching Sum Digits II

3972. Valid Subarrays With Matching Sum Digits II

You are given an integer array nums and an integer digit x.

A subarray nums[l..r] is considered valid if the sum of its elements satisfies both of the following conditions:

  • The first digit of the sum is equal to x.
  • The last digit of the sum is equal to x.

Return the number of valid subarrays.

Read more
[LeetCode] Minimum Operations to Transform String

3675. Minimum Operations to Transform String

You are given a string s consisting only of lowercase English letters.

You can perform the following operation any number of times (including zero):

  • Choose any character c in the string and replace every occurrence of c with the next lowercase letter in the English alphabet.

Return the minimum number of operations required to transform s into a string consisting of only 'a' characters.

Note:Consider the alphabet as circular, thus 'a' comes after 'z'.

Read more