educative.io

Time complexity should be O(n+n) = O(n)


#1

Since the last loop can potentially run for O(n). Good problem tho.