The problem statement is: You are given an array and you need to find number of triplets of indices(i,j,k) such that the elements at those indices are in geometric progression for a given common ratio, r and i<j<k. For example, arr=[1,4,16,64]. If r=4, we have [1,4,16] and [4,16,64] at indices (0,1,2) and (1,2,3). I have a solution but I am unable to understand it. Can anyone help me out? Answer The way this problem works is that it uses “dict” to keep a running count of each number in the array. Then, it uses “dictPairs” to keep a running count