Java Collection

Hey,
I am newbie to java competitive programming.
I am facing issues with java collections.
Like c++ have vector pair but java doesn’t have how can we implement for the same. Many questions use this but I am unable to solve them due to this. I am attaching a question below. If anyone can guide me that’ll be great!

I think to use the pair is equal to use a struct in C or a class in C++/Java, you can create a Java list with an object that has two proprieties.

This makes the code more readble.

Here you can find my github work with an engineering approach in C++ to solve the Competitive Programming problem.

Why this? because the machine code is happy with any type of code, but the other people are uncomfortable with bad code.

I hope I clarify your problem.

I create also a subreddit to talk of clean code in competitive programming https://www.reddit.com/r/ContestProgramming/