LeetCode 312. Burst Balloons[ Algorithm + Code Explained]
One of the most frequently asked coding interview questions on Arrays in companies like Google, Facebook, Amazon, LinkedIn, Microsoft, Uber, Apple, Adobe etc.
LeetCode : Burst Balloons
Problem URL - https://leetcode.com/problems/burst-balloons/
Question :Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get nums[left] * nums[i] * nums[right] coins. Here left and right are adjacent indices of i. After the burst, the left and right then becomes adjacent.
Find the maximum coins you can collect by bursting the balloons wisely.
Note:
You may imagine nums[-1] = nums[n] = 1. They are not real therefore you can not burst them.
0 gt n lt 500,
0 gt nums[i] lt 100
Input: [3,1,5,8]
Output: 167
Explanation: nums = [3,1,5,8] -- [3,5,8] -- [3,8] -- [8] -- []
coins = 3*1*5 + 3*5*8 + 1*3*8 + 1*8*1 = 167
Connect with me on LinkedIn at: https://www.linkedin.com/in/jayati-tiwari/
Видео LeetCode 312. Burst Balloons[ Algorithm + Code Explained] канала jayati tiwari
LeetCode : Burst Balloons
Problem URL - https://leetcode.com/problems/burst-balloons/
Question :Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get nums[left] * nums[i] * nums[right] coins. Here left and right are adjacent indices of i. After the burst, the left and right then becomes adjacent.
Find the maximum coins you can collect by bursting the balloons wisely.
Note:
You may imagine nums[-1] = nums[n] = 1. They are not real therefore you can not burst them.
0 gt n lt 500,
0 gt nums[i] lt 100
Input: [3,1,5,8]
Output: 167
Explanation: nums = [3,1,5,8] -- [3,5,8] -- [3,8] -- [8] -- []
coins = 3*1*5 + 3*5*8 + 1*3*8 + 1*8*1 = 167
Connect with me on LinkedIn at: https://www.linkedin.com/in/jayati-tiwari/
Видео LeetCode 312. Burst Balloons[ Algorithm + Code Explained] канала jayati tiwari
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![Minimum Number of Arrows to Burst Balloons - (Facebook, Amazon)](https://i.ytimg.com/vi/y_n1rALjKzI/default.jpg)
![Balloon burst problem dynamic programming | Leetcode #312](https://i.ytimg.com/vi/uG_MtaCJIrM/default.jpg)
![Leetcode 309. Best Time to Buy and Sell Stock with Cooldown [ Algorithm + Code Explained]](https://i.ytimg.com/vi/w6xk5Po-DX0/default.jpg)
![Skyline Problem](https://i.ytimg.com/vi/GSBLe8cKu0s/default.jpg)
![LeetCode Dynamic Programming Problems | Stream Highlights](https://i.ytimg.com/vi/8RIqJDDgtU8/default.jpg)
![Dynamic Programming Interview Question - Burst Balloons (HARD)](https://i.ytimg.com/vi/J0zrZN-7uQs/default.jpg)
![Burst Balloon Dynamic Programming[Leetcode]](https://i.ytimg.com/vi/IFNibRVgFBo/default.jpg)
![Text Justification Algorithm (LeetCode)](https://i.ytimg.com/vi/GqXlEbFVTXY/default.jpg)
![The Change Making Problem - Fewest Coins To Make Change Dynamic Programming](https://i.ytimg.com/vi/jgiZlGzXMBw/default.jpg)
![AMAZON CODING INTERVIEW QUESTION - SPIRAL MATRIX](https://i.ytimg.com/vi/BdQ2AkaTgOA/default.jpg)
![花花酱 LeetCode 312. Burst Balloons - 刷题找工作 EP19](https://i.ytimg.com/vi/z3hu2Be92UA/default.jpg)
![LeetCode 304. - Range Sum Query 2D - Immutable [Algorithm + Code Explained ]](https://i.ytimg.com/vi/7mL8KJ4Pi70/default.jpg)
![LeetCode 452. Minimum Number of Arrows to Burst Balloons THOUGHT PROCESS EXPLAINED WITH WHITE BOARD](https://i.ytimg.com/vi/lslPyeA3njw/default.jpg)
![The Egg Dropping Problem - Interview Question](https://i.ytimg.com/vi/o_AJ3VWQMzA/default.jpg)
![Leetcode 448. Find All Numbers Disappeared in an Array [ Solution + Code Explained]](https://i.ytimg.com/vi/jSfDPVIYe1s/default.jpg)
![Leetcode 581. Shortest Unsorted Continuous Subarray [ Solution + Code Explained]](https://i.ytimg.com/vi/iVKfN1zJSxI/default.jpg)
![LeetCode 226. Invert Binary Tree[ Solution + Code Explained] Mirror Tree](https://i.ytimg.com/vi/Lt6VBVUs5k4/default.jpg)
![LeetCode 85. Maximal Rectangle [ Solution + Code Explained]](https://i.ytimg.com/vi/Q39oYu4p9gY/default.jpg)
![LeetCode 139. Word Break - Interview Prep Ep 79](https://i.ytimg.com/vi/iWenZCZEBIA/default.jpg)
![Leetcode 123. Best Time to Buy and Sell Stock III [ Algorithm + Code Explained]](https://i.ytimg.com/vi/gVavspgEHyM/default.jpg)