Conversation
This one is with Better Space and Time complexity with not extra variable space or Vector. Please have a Look
|
That's utterly wrong. Read the problem statement again. |
This may Be Easier for the People to understand and implement with same complexity of yours
|
I believe you copied the code from here. I would not encourage copying and making pull requests, but if @royalpranjal doesn't have any problem, then your solution is good to go except changing 'tahn' to 'than' in this line. The OP has this mistake in his code which reminded me of the same when I saw your code. |
|
No absolutely not.. I too support git family standards and would never go for copying. Actually the same question was tough by one of my mentor so I did it that way. And about the mistake in 'tahn' that may by my typo mistake... I'll make it correct thanks for seeing that |
|
The code looks fine but it doesn't follow the InterviewBit function template. Can you update the snippet according to the InterviewBit norm ? |
|
The interviewBit code panel and online judge also accepted it so i think it does follow the function template. If it my code really needs some changes then, can make it too, theirs no prob at all. |
This one is with Better Space and Time complexity with not extra variable space or Vector. Please have a Look