Randhir
BAN USER
- 0of 0 votes
AnswersList<Integer> list=Arrays.asList(1,2,3,4,5,6);
- Randhir in India
Iterator it=list.iterator();
while(it.hasNext()){
System.out.println(it.next());
}
The above code will iterate sequentially through 1 to 6. Can we iterate the same list alternatively so that it will print 1,3,5 without changing the while loop.| Report Duplicate | Flag | PURGE
Wissen Technology Java Developer Java - 0of 0 votes
AnswerYou are given an array of length N that contains only integer.
- Randhir in United States
A number in this array is called a special number if it is divisible by at least one other number in the array.
Write a program to print the count of special number of array.
Input format :
First Line - N
Second line - N space separated integer.
Output format :
print the count of special number in the array.
constraints
1<= N <= pow(10,5)
Note - divisible with same number will not considered.
Example -
input
N=3
Array= 5 3 10
output
1
Description - 10 is divided by 5,
5 and 3 are not divided by any number| Report Duplicate | Flag | PURGE
Repcoragkemmer, Data Scientist at Bankbazaar
Have years of experience to treating variety of outpatients with modalities such as massage, exercise, paraffin, joint mobilization, mechanical traction ...
Open Chat in New Window