Tag: coding exercise
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 …
Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character. Example 1: Input: S = …
Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. The given integer is guaranteed to fit within the …
Write a class RecentCounter to count recent requests. It has only one method: ping(int t), where t represents some time in milliseconds. Return the number of pings that have …
Question: Write a function to compute the number of bits required to convert a integer to another. For example, Input 29 (or 11101), 15 (or 01111) the output is …