I\'m trying to reduce the verbose nature of the second method and optimize the time complexity. Would like to know why I\'m getting an error here?
/*function