Category: c / c++
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 a list of dominoes, dominoes = is equivalent to dominoes = if and only if either (a==c and b==d), or (a==d and b==c) – that is, one domino …
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 a Snake game that is played on a device with screen size = width x height. Play the game online if you are not familiar with the game. …
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 …