calmdown_69's blog

By calmdown_69, history, 7 months ago, In English

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.

Read more »

 
 
 
 
  • Vote: I like it
  • +34
  • Vote: I do not like it