Ranking Solution for Hash Code 2022

I would like to share my solution and receive feedback into improving it