Tag: C++ recursion
Given a binary tree root, repeatedly delete all leaves that have even values. That is, if after deletions, a node becomes a leaf with an even value, it too …
Given two strings s1 and s2, determine if s1 is a subsequence of s2. A string a is a subsequence of another string b if you can delete some …
Given a binary tree root, return the sum of each of the diagonals in the tree starting from the top to bottom right. For example, given 1 / \ …
A strobogrammatic number is a number that looks the same when rotated 180 degrees (looked at upside down). Find all strobogrammatic numbers that are of length = n. Example: …
A happy string is a string that: consists only of letters of the set . s != s for all values of i from 1 to s.length – 1 …