0%

If all you have is a hammer, everything looks like a nail

``````- Abraham Maslow, 1962
``````

## Rare technique

1. KMP
2. Manacher’s algorithm

##

# uncategorized

1. Binary Lifting

# Prerequisite

1. What is a binary-heap
2. It takes O(N) to heapify an array contains N integer

Video

# Q1. 1534. Count Good Triplets

Given an array of integers arr, and three integers a, b and c. You need to find the number of good triplets.

A triplet (arr[i], arr[j], arr[k]) is good if the following conditions are true:

0 <= i < j < k < arr.length
|arr[i] - arr[j]| <= a
|arr[j] - arr[k]| <= b
|arr[i] - arr[k]| <= c
Where |x| denotes the absolute value of x.

Return the number of good triplets.

## Note

From constrain `3 <= arr.length <= 100`, we know this can be solved by `complete search` aka `Brute force`

Ranking: 256 / 14309 🧐🤔😑

# Q1. 1528. Shuffle String

Given a string s and an integer array indices of the same length.

The string s will be shuffled such that the character at the ith position moves to indices[i] in the shuffled string.

Return the shuffled string.