I made a short tutorial on answering range queries offline with Mo’s algorithm on my YouTube channel here:
Offline Range Queries with Mo’s Algorithm
I explain how to use Mo’s algorithm in general and solve the problem Codeforces - Little Elephant and Array using it in the video.
Alternative sorting order for Mo’s algorithm:
An alternative sorting order for Mo’s algorithm by gepardo
Here are some practice problems (feel free to recommend some in the comments):