Computer Science, asked by ayazturi96, 5 months ago

Algorithm prefixAvg:

      Input: An n-element array A
      Output: Elements in array are unique
int  A[n];
for(int i=0, i<n, i++){
for(int j=i+1; j<n; j++){
 if(A[i]==A[j]){
return false;
 }
}
}
return true​

Answers

Answered by jai696
1

\huge\red{\mid{\fbox{\tt{Using\: Python\: 3}}\mid}}

prefix_avg = lambda arr: len(set(arr)) == len(arr)

for arr in [[1, 2, 3], [69, 999, 69]]:

print("Unique:", prefix_avg(arr))

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions