Madhumitha Kannan
1 min readJun 28, 2020

--

Hi!

That's a good solution if you do not consider the space complexity constraints on this problem(mentioned in condition #2). Notice that this problem requires a constant space complexity O(1) meaning space required by the algorithm does not grow with the size of the data on which the algorithm is operating.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Madhumitha Kannan
Madhumitha Kannan

No responses yet

Write a response