You are viewing a single comment's thread. Return to all comments →
but in that case we would get a space after the last element.
but accroding to test case (given) we should not get a space after last element.
so how can you modify without getting a space at end the end in your code
you can run and check, if in test case space is not allowed after last element you can add space till n-1 length and skip for other.