I am stuck on this for a long time now. Is this a hard one or is there a fundamental algorithm or approach that I am not aware of. Any hints would be appreciat…