You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* Given a read only array of n + 1 integers between 1 and n, find one number that repeats in linear time using less than O(n) space and traversing the stream sequentially O(1) times.
*/
public int repeatedNumber(final List<Integer> a) {
if (a.isEmpty())
return -1;
int i = 0;
HashMap<Integer, Boolean> integerBooleanHashMap = new HashMap<Integer, Boolean>();