1COUNT - Dynamic Programming

i have using two pointer technique . the first output of maximum length is correct . But 2nd output of printing array after is not correct.
ide: https://ide.codingblocks.com/s/197510

Hello @Vishal123,

I have corrected your code:

Refer to the comments for better understanding.

Hope, this would help.
Give a like if you are satisfied.