Frage im Vorstellungsgespräch bei Oracle

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

Antworten zu Vorstellungsgespräch

Anonym

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

Anonym

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.