Print Distinct/Unique Values of an Array | Java

preview_player
Показать описание

Subscribe to my channel so that you do not miss any topic.

My other videos-
Рекомендации по теме
Комментарии
Автор

this program only remove the duplicates but we need unique value ex in this array 5 and 7 are the unique values

hogwartsexpress
Автор

Plz send the code bro actually its not working code

sureshirla
Автор

Bro while writing the program u haven’t sort the arrays .. actually we should add arrays.sort method before writing for loop right bro ?

adingathamsaakanna
Автор

Thank you so much for posting this video ☺️ hoping for more videos from this channel

harshithareddy
Автор

Bro kindly do a video regarding split an array into 2 and merge 2 array into 1

abhiram
Автор

Can u please post video how to solve this question. In an array u have to identify the unique pairs which is sum of 11 and print. a={1, 3, 5, 6, 10, 7, 4, 3}. I never seen any videos for this video

vigneshr
Автор

loving your channel ....sir please upload max ANd min salary program also

gaurav
Автор

Bro put a[lst index ] in outer for loop

Egnahci
Автор

Bro what if no district elements are found in given 🤔 array ....??(u have specify that case also )

guruvarun
Автор

wrong way to solving this problem, before posting any video try to do on its on

serickwick
Автор

Sir code m Correct answer nahe aa raha hai

hwhwflp
Автор

bro first tell me you know the meaning of unique element or not ...the unique element means only one element occure in once time only

KaranRathod-jinu
Автор

import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int []a=new int[n];
for(int i=0;i<a.length;i++){
a[i]=sc.nextInt();
}
Arrays.sort(a);

for(int i=0;i<a.length-1;i++){
if(a[i]!=a[i+1])
System.out.println(a[i]);
}
}
}
it is giving wrong output.

srisaisrinivasvemula
visit shbcf.ru