Arrays intersection

https://ide.codingblocks.com/#/s/31076
problem link-https://hack.codingblocks.com/contests/c/509/209
whats the problem with above code.It is not passing any of the testcases.

Even for the sample test case, the output should be
[1, 1, 2, 2, 3]
But your output is [1, 1, 2, 2, 3, ]
There is an extra comma [,].
Handle this carefully as the online judge matches each character of the output.

1 Like

how we handle this extra comma?