Tag: c++
There is a special keyboard with all keys in a single row. Given a string keyboard of length 26 indicating the layout of the keyboard (indexed from 0 to …
Given an array of integers A, return the largest integer that only occurs once. If no integer occurs once, return -1. Example 1: Input: Output: 8 Explanation: The maximum …
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 …
Design and implement a TwoSum class. It should support the following operations: add and find. add – Add the number to an internal data structure. find – Find if …