educative.io

Educative: Interactive Courses for Software Developers

Can we do in O(n) complexity which will be considered as optimal solution ,I think

hi @SRI_VARDHAN
So far this is the best possible solution for this problem but if you have a solution better than this one then please do share it with us. Thanks