Find the pair of elements wiith product less than or equal to given number
Answers
Answered by
0
[] = {1, 2, 4, 5, 8, 10}
key = 9
Output : 5
Elements less than or equal to 9 are 1, 2,
4, 5, 8 therefore result will be 5.
Input : arr[] = {1, 2, 2, 2, 5, 7, 9}
key = 2
Output : 4
Elements less than or equal to 2 are 1, 2,
2, 2 therefore result will be 4.
key = 9
Output : 5
Elements less than or equal to 9 are 1, 2,
4, 5, 8 therefore result will be 5.
Input : arr[] = {1, 2, 2, 2, 5, 7, 9}
key = 2
Output : 4
Elements less than or equal to 2 are 1, 2,
2, 2 therefore result will be 4.
Similar questions