Tag: c++
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 …
Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 00111001011110000010100101000000). Follow up: If …