Tag: C++ coding exercise
Given a string and an integer k, you need to reverse the first k characters for every 2k characters counting from the start of the string. If there are …
You have 4 cards each containing a number from 1 to 9. You need to judge whether they could operated through *, /, +, -, (, ) to get …
You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. The path does not …
Given two sparse matrices A and B, return the result of AB. You may assume that A’s column number is equal to B’s row number. Example: Input: A = …
Given the root of a binary tree, find the maximum average value of any subtree of that tree. (A subtree of a tree is any node of that tree …