Hugo's Blog
-
-
-
-
💯✅ LeetCode 2181. Merge Nodes in Between Zeros | Go
You are given the head of a linked list, which contains a series of integers separated by 0's. The beginning and end of the linked list will have Node.val == 0.
💯✅ LeetCode 1480. Running Sum of 1d Array | Go
Given an array nums
. We define a running sum of an array as runningSum[i] = sum(nums[0]...nums[i])
. Return the running sum of nums
.
💯✅ LeetCode 1550. Three Consecutive Odds | Go
Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false.
LeetCode 1382. Balance a Binary Search Tree - Easy Solution | Go
Given the root
of a binary search tree, return a balanced binary search tree with the same node values. If there is more than one answer, return any of them.
[O(1) Time and Space] LeetCode 1791. Find Center of Star Graph - Easy Solution | Go
In a star graph, the center node will appear in each of the edges which means every node will contain the center node. So, we just need to find the common node in the first two edges.
LeetCode 0001. Two Sum - Hash Map Solution | Go, Python, C++
Given an array of integers nums
and an integer target
, return indices of the two numbers such that they add up to target
.
[✅ Beats 💯] LeetCode 1052. Grumpy Bookstore Owner - Easy Solution | Go
There is a bookstore owner that has a store open for n
minutes. Every minute, some number of customers enter the store. You are given an integer array customers
of length n
where customers[i]
is the number of the customer that enters the store at the start of the ith
minute and all those customers leave after the end of that minute.