Count Triplets Hackerrank Solution Python | Hackerrank Solution in Python

Опубликовано: 05 Октябрь 2024
на канале: Engineers Revolution
5,623
22

Count Triplets
Problem
You are given an array and you need to find number of tripets of indices (i,j,k)such that the elements at those indices are in geometric progression for a given common ratio r and i less than j less than 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).
Github link
https://github.com/RakeshKrishna143/h...