This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getAverageValue(min, max) { | |
return (min + max) / 2; | |
} | |
getAverageValue(4, 8); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GitHub Gist works! and Ngx-Ggist too! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var productExceptSelf = function(nums) { | |
const left_side = new Array(nums.length); | |
const right_side = new Array(nums.length); | |
const result = new Array(nums.length) | |
left_side[0] = 1; | |
right_side[nums.length-1] = 1; | |
for (let i=1 ; i<nums.length ; i++) { | |
left_side[i] = left_side[i-1] * nums[i-1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function balanced(theString) { | |
const stack = []; | |
for (let par of theString) { | |
if (par == '(' || par == '{' || par == '[') { | |
stack.push(par); | |
} | |
if (par == ')') { | |
const parApertura = stack.pop(); | |
if (parApertura != '(') { |