if yes,please give some hint to solve it
Can i do this question in O(n) complexty
Yes you can do.
You can use the floyd algo or the hashing based approach.
Refer the approaches from here
if yes,please give some hint to solve it
Yes you can do.
You can use the floyd algo or the hashing based approach.
Refer the approaches from here