Hello everyone.
Reference: here
problem statement:
An array is good if all subarrays have atleast 1 element in them whose frequency is 1.
Good : 1,2,1
Good: 1,2,5,2,4,3,4
Bad: 1,2,3,1,2,3
O(N^2) solution is easy but can anyone share a better approach for this question.
Thank you.