Showing 3 of 67 questions
Find the lowest common ancestor of two nodes in a given binary tree. The lowest common ancestor is defined as the farthest node from the root that is an ancestor of both nodes.
#1. Lowest Common Ancestor of a Binary Tree
The problem asks you to find the total number of distinct palindromic subsequences within a given string. Remember that subsequences don't have to be contiguous.
#2. Count Palindromic Subsequences
You're given a list of votes for teams, where each vote ranks the teams in order. Determine the final ranking of the teams based on these votes, prioritizing teams with higher rankings in the votes.
#3. Rank Teams by Votes