Facebook(Meta) |Phone | Interview
Anonymous User
4692

q1: given a matrix (2d array), check and see if the values of the diagonals are equal
q2: given 2 vectors of tuples where the first value refers to the key, and the second the number of occurences, return a third vector of the product of the first 2
ex: {(5, 2), (1, 6)} = [5, 5, 1, 1, 1, 1, 1, 1]
{(4, 2), (2, 5), (1,1)} = [4, 4, 2, 2, 2, 2, 2, 1]
result: {(20, 2), (2, 5), (1,1)} = [20, 20, 2, 2, 2, 2, 2, 1]

Comments (5)