Pergunta de entrevista da empresa Tripadvisor

Java: Given an array of non negative integers, and a non negative sum, write a method that returns the total number of pairs of integers that add up to the sum. The array can contain repeated numbers

Resposta da entrevista

Sigiloso

11 de jun. de 2015

I gave them an answer that worked, but was O(n^2). I worked on using a hash table to get something O(n) but I didn't get it.