LinkedIn | Phone Screen | Two Sum III
Difficulty: MEDIUMCategory: InterviewExperienceFrequency: 1Asked On 2018-03-17Added By Anonymous
Source: Link
1.write a program to list factors of a given number
2.e.g. for 12, factors are 1, 2., 3, 4, 6, 12
1.https://leetcode.com/problems/two-sum-iii-data-structure-design (premium)
2.Implement below methods
3.//stores the number in some data structure
4.void store(n);
//tests whether the given number is present as sum of 2 numbers from the data structure store
boolean test(v);
e.g. store -> 1, 3, 5, 6
tests
4 = true (1 + 3)
5 = false (no sum will result into this)
6 = true (1 + 5)