Pythagoras Triplet

how can i do this and help me how can i come out

@khemchandrs
Watch this hint video to get the idea how to solve this problem in O(1) time .