When given a singly linked list how can we manage to reverse it? Like the following example, if the input linked list is 1->2->3->4->5->NULL, can we reverse it into the output as 5->4->3->2->1->NULL?

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.

**Example 1:**

**Input: **[-4,-1,0,3,10]

**Output: **[0,1,9,16,100]

**Example 2:**

**Input: **[-7,-3,2,3,11]

**Output: **[4,9,9,49,121]

**Note:**

`1 <= A.length <= 10000`

`-10000 <= A[i] <= 10000`

`A`

is sorted…

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…

**Problem**

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…

*Prerequisite: Tree Traversal In JavaScript*

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…

*Prerequisite: Tree Traversal In JavaScript*

For our last ‘She’s coding’ data structure and algorithm practice event, we chose to solve maximum depth of N-ary tree problem(*l*** ink**). 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…`

For my last technical interview, I was asked about how to trap rainwater. (Not really 🤪). It was a hard level *Leetcode* problem. I found it challenging, that’s why I’d like to write a blog about it. …

**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*

Write…

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.

Given `head`

, the head of a linked list, determine if the…

Multi-human-lingual and multi-programming-lingual | https://www.gaierken.com/