Sollicitatievraag bij Oracle

Write a program to find the numbers which are greater than the given number from an array. Count only distinct numbers.

Antwoorden op sollicitatievragen

Anoniem

21 okt 2016

Initialize empty array.Iterate through each number and check if the number is present in the new array and if the number is present in the new array then remove from the new array otherwise add it in the new array if its greater than the specified number. finally count the size of the new array.

3

Anoniem

18 aug 2017

create a set for distinct numbers. sort it.and iterate set, add the elements in new array, until you get the given number.