Problem 1577 · Medium

Number of Ways Where Square of Number Is Equal to Product of Two Numbers

Count every pair product in one list in a hash table, then look up each square from the other list in constant time.

Open the interactive visualisation