ParentFull threadnamanaggarwal·I have been asked to implement this in Google, Amazon and Facebook interviews and used the same method. :)View on HN