>>108089380
the CL code has a lot of looping. It seems that for each post he gets the top posts in the function (add-related). I don't really understand why but maybe I am dumb.
Problem description:
Read the posts JSON file.
Iterate over the posts and populate a map containing: tag -> List<int>, with the int representing the post index of each post with that tag.
Iterate over the posts and for each post:
Create a map: PostIndex -> int to track the number of shared tags
For each tag, Iterate over the posts that have that tag
For each post, increment the shared tag count in the map.
Sort the related posts by the number of shared tags.
Write the top 5 related posts for each post to a new JSON file.