Search Results for: quicksort
Given an integer array with no duplicates. A maximum tree building on this array is defined as follow: The root is the maximum number in the array. The left …
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 …
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 …
In Javascript, you can use Number.prototype.toFixed(n) that will return a string version that has n decimal places. For example, (3).toFixed(3) // "3.000" (3.15).toFixed(3) // "3.150" The toFixed will round …
Given an array A of positive lengths, return the largest perimeter of a triangle with non-zero area, formed from 3 of these lengths. If it is impossible to form …