Google | Phone Screen
Anonymous User
2598

Find a pair of indexes i, j such it has the maximum value of vi + vj + | ki - kj|

sample input: [ [1, 2], [3, -4], [4, 8], [5, 6], [9, -1], [10, 11] ]

constraint : 0 < k1 < k2 < ... kn

Comments (13)