Yahoo India Web Search

Search results

  1. www.hackerrank.com › challenges › equal-stacksEqual Stacks | HackerRank

    You have three stacks of cylinders where each cylinder has the same diameter, but they may vary in height. You can change the height of a stack by removing and discarding its topmost cylinder any number of times.

  2. Find the maximum possible height of the stacks such that all of the stacks are exactly the same height. This means you must remove zero or more cylinders from the top of zero or more of the three stacks until they are all the same height, then return the height.

  3. Sep 29, 2020 · Question: Given 3 arrays, where each element represent the height of a cylinder. Find the maximum possible height of equal stacks by removing one or more cylinders from the original stack. Example: Input: n1 [] = {3, 2, 1, 1, 1} n2 [] = {4, 3, 2} n3 [] = {1, 1, 4, 1}

  4. Oct 26, 2020 · Equal Stacks is a programming challenge on HackerRank that uses the stack data structure. You need to balance out 3 stacks such that they have the maximum height. Watch the video to...

  5. We would like to show you a description here but the site won’t allow us.

  6. In this HackerRank in Data Structures - Equal Stacks solutions. You have three stacks of cylinders where each cylinder has the same diameter, but they may vary in height. You can change the height of a stack by removing and discarding its topmost cylinder any number of times.

  7. function equalStacks(h1: number[], h2: number[], h3: number[]): number { let s1 = h1.reduce(((sum, h) => sum + h), 0); let s2 = h2.reduce(((sum, h) => sum + h), 0); let s3 = h3.reduce(((sum, h) => sum + h), 0); let [i, j, k] = [0, 0, 0]; while (i < h1.length && j < h2.length && k < h3.length) { if (s1 === s2 && s2 == s3) return s1; if (s1 >= s2 ...

  1. People also search for