Google coding interview question

Revision en3, by calmdown_69, 2020-09-02 15:03:55

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.

Tags coding interviews


  Rev. Lang. By When Δ Comment
en3 English calmdown_69 2020-09-02 15:03:55 0 (published)
en2 English calmdown_69 2020-09-02 15:03:36 117
en1 English calmdown_69 2020-09-02 15:02:45 327 Initial revision (saved to drafts)