pairing of ‘a’ in string i with ‘b’ of string j such that j>i and if i==j then consider only those b which is on the right of ‘a’, through this I got this formula, bk(k-1)/2 + tempb and used this formula on each ‘a’
And then adjust it for k times repeat. Nice.
the idea was too complicated though
1 Like