Category: c / c++
Given a string s and an integer n, rearrange s into n rows so that s can be read vertically (top-down, left to right). Constraints Length of s ≤ …
Given a positve integer n, find the length of its Collatz sequence. The Collatz sequence is generated sequentially where: n = n / 2 if n is even n …
Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 10^9 + 7. Example …
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 a list of integers nums, return whether there’s two numbers such that one is a triple of another. Constraints n ≤ 100,000 where n is the length of …