LeetCode - Binary Tree Right Side View
Question Definition
Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
More …Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.
More …Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by level).
More …A character in UTF8 can be from 1 to 4 bytes long, subjected to the following rules:
For 1-byte character, the first bit is a 0, followed by its unicode code. For n-bytes character, the first n-bits are all one’s, the n+1 bit is 0, followed by n-1 bytes with most significant 2 bits being 10. This is how the UTF-8 encoding would work:
Char. number range | UTF-8 octet sequence (hexadecimal) | (binary) ——————–+——————————————— 0000 0000-0000 007F | 0xxxxxxx 0000 0080-0000 07FF | 110xxxxx 10xxxxxx 0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx 0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx Given an array of integers representing the data, return whether it is a valid utf-8 encoding.
More …Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.
More …We are stacking blocks to form a pyramid. Each block has a color which is a one letter string, like 'Z'
.
For every block of color C
we place not in the bottom row, we are placing it on top of a left block of color A
and right block of color B
. We are allowed to place the block there only if (A, B, C)
is an allowed triple.
We start with a bottom row of bottom, represented as a single string. We also start with a list of allowed triples allowed. Each allowed triple is represented as a string of length 3.
Return true if we can build the pyramid all the way to the top, otherwise false.
More …