Tag: c++
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. …
Convert a Roman numeral value (ranged from 1 to 3999) to Arabic integer. Letter by Letter Conversion from Roman to Arabic The first few Roman numbers are: I, II, …
Given a binary tree root, return whether it’s a binary search tree. A binary tree node is a binary search tree if : All nodes on its left subtree …
Given a binary tree, you are asked to check whether it is a mirror of itself (i.e, symmetric around its center): https://leetcode.com/problems/symmetric-tree/ For example, this binary tree is symmetric: …
Say you have an array for which the ith element is the price of a given stock on day i. Design an algorithm to find the maximum profit. You …