Category: c / c++
Given the root of a binary tree, consider all root to leaf paths: paths from the root to any leaf. (A leaf is a node with no children.) A …
Given two numbers, hour and minutes. Return the smaller angle (in sexagesimal units) formed between the hour and the minute hand. Example 1: Input: hour = 12, minutes = …
Given a non-negative integer num, return the number of steps to reduce it to zero. If the current number is even, you have to divide it by 2, otherwise, …
In C++, we use set, multiset, unordered_multiset, unordered_set to store a hash set. C++ set/multiset implements a Red-Black tree that maintains the order of the elements. On the other …
Given an integer n, your task is to count how many strings of length n can be formed under the following rules: Each character is a lower case vowel …