I wrote it as challenge, I didn't look up any existing C/C++ and stuff implementations
Alternatives
https://crates.io/crates/justify - based on a quick glance at the source code, it may be a
little slower and require a more memory compared to this one.