unlibjs
v0.0.1
Published
jff utility library
Downloads
5
Readme
unlib.js
Although the library may be useful for solving real life problems, it has been created primarily for educational purposes.
The content of unlib.js originates from various JavaScript interview tasks, and therefore provides information on different algorithms and coding techniques. You are encouraged to contribute to the knowledge, including:
- Suggest new functionality via Issues
- Write new or work on existing implementations
- Add new tests; we use Jest
- Analyze and improve performance of library functions
Methods
online
For given lists of presence hours of several users, returns the intervals when all of them were online.
unlibjs.online(
[[8, 12], [17, 22]],
[[5, 11], [14, 18], [20, 23]]
) // -> [[8, 11], [17, 18], [20, 22]]
rle
Implements a Run-Length Encoding algorithm on A-Z strings.
unlibjs.rle('ABBCCC') // -> AB2C3