S&P Global interview question

Java, AWS, APIs, Arrays, HashMap, Lambda features, Maths, Logical puzzle