Unable to pass test case

The code works fine on all custom inputs but still unable to pass test case 3.

hello @vaani787

pls save ur code here-> https://ide.codingblocks.com/
and share its url with me

Hey could you help me with it?

go to this link -> https://ide.codingblocks.com/
paste ur code , press ctrl + s and then save
a url will be generated in ur search bar , share that url with me.

share the url here only,no need to mail

@vaani787
are u facing any issue in link sharing?

try this case->
3
2
3
4
6

u cannot use same element twice .
here ur code is considering 3 two times which is wrong.

use sorting and two pointers