🏎️ Fast What mistake have you learned most from?
🌊 Zero Two this feels like an interview question lol
3y, 40w 8 replies
Ice given 2 nodes on a binary tree, return the lowest common ancestor in O(N) time
3y, 40w 5 replies
🌊 Zero Two take one node, go up to root, take the other node go up to root or until u hit one u already seen.
3y, 40w 2 replies
Ice true, but only if child nodes have references to parent nodes. otherwise you'd need a top-down recursive approach where you return if the current node is the one of the child nodes in the callback
3y, 40w reply
Login or register your account to reply