Question d’entretien chez Oracle

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

Réponses aux questions d'entretien

Utilisateur anonyme

21 oct. 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

Utilisateur anonyme

18 août 2017

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