Given an array of integers
A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order.
1 <= A.length <= 10000
-10000 <= A[i] <= 10000
In a town, there are N people labelled from 1 to N. There is a rumor that one of these people is secretly the town judge.If the town judge exists, then:1. The town judge trusts nobody.
2. Everybody (except for the town judge) trusts the town judge.
3. There is…
Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are not.You need to merge them into a new binary tree. The merge rule is…
For our last She’s coding data structure and algorithm event I chose minimum depth of binary tree problem to practice tree traversing with our participants. …
What is Redux-Saga?
Redux-Saga, like Thunk, is a redux middleware for React/Redux application. With the help of Redux-Saga, the side effect becomes easier to manage, more efficient to execute, simple to test and better at handling the failures. It has access to the full redux application state and it can…
For our last ‘She’s coding’ data structure and algorithm practice event, we chose to solve maximum depth of N-ary tree problem(link). We had interesting discussion about approaches to solve it. In the following blog, I’ll share the common solution to this problem.
Given a n-ary…
Number of Recent Calls is one of the leetcode questions that tripped us up. (As you can see how many downvotes it has.🧐) In the following blog, I’ll try to explain the problem and the example line by line to make it easier to understand.
Explanation of the question
Cycle detection is the algorithmic problem of finding a cycle in a sequence of iterated function values, for example, the classic linked list loop detection problem. There are different solution. For the following Leetcode example, I’ll explain true solutions.
head, the head of a linked list, determine if the…