988 Flip Equivalent Binary Trees
Flip Equivalent Binary Trees For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees. A binary tree X is flip equivalent to a ...
Flip Equivalent Binary Trees For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees. A binary tree X is flip equivalent to a ...
Flip Equivalent Binary Trees For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees. A binary tree X is flip equivalent to a ...
Cousins in Binary Tree II Given the root of a binary tree, replace the value of each node in the tree with the sum of all its cousins’ values. Two nodes of a binary tree are cousins if they have...
Kth Largest Sum in a Binary Tree You are given the root of a binary tree and a positive integer k. The level sum in the tree is the sum of the values of the nodes that are on the same level. Re...
Split a String Into the Max Number of Unique Substrings Given a string s, return the maximum number of unique substrings that the given string can be split into. You can split string s into any ...
Parsing A Boolean Expression A boolean expression is an expression that evaluates to either true or false. It can be in one of the following shapes: 't' that evaluates to true. 'f' that evaluate...
Find Kth Bit in Nth Binary String Given two positive integers n and k, the binary string Sn is formed as follows: S1 = "0" Si = Si - 1 + "1" + reverse(invert(Si - 1)) for i > 1 Where + deno...
Count Number of Maximum Bitwise-OR Subsets Given an integer array nums, find the maximum possible bitwise OR of a subset of nums and return the number of different non-empty subsets with the maxi...
Longest Happy String A string s is called happy if it satisfies the following conditions: s only contains the letters 'a', 'b', and 'c'. s does not contain any of "aaa", "bbb", or "ccc" as a sub...
Separate Black and White Balls There are n balls on a table, each ball has a color black or white. You are given a 0-indexed binary string s of length n, where 1 and 0 represent black and white ...