๐
This file contains hidden or 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
const problemSolution = function(str){ | |
let val = str.split(''), | |
stack = [], | |
count = 0; | |
stack.push(val[0]); | |
for(let i=1; i< val.length; i++) { | |
if((/[a-z]/.test(stack[stack.length-1])) && (/[a-z]/.test(val[i]))) { | |
console.log('1'+ val[i]); | |
return count; | |
} |
This file contains hidden or 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
const myArray = [ | |
{id: 1, name: 'Abhinav', email: '[email protected]'}, | |
{id: 2, name: 'Aviral', email: '[email protected]'}, | |
{id: 3, name: 'Jitendra', email: '[email protected]'}, | |
{id: 4, name: 'Rajesh', email: '[email protected]'}, | |
{id: 5, name: 'Abhinav', email: '[email protected]'}, | |
{id: 6, name: 'Akash', email: '[email protected]'}, | |
]; | |
let arrayCopy = JSON.parse(JSON.stringify(myArray)); |
This file contains hidden or 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
'use strict'; | |
function solution(S) { | |
var arr = []; | |
var K = 0; | |
for (var i=0; i<S.length; i++) { | |
if (S[i]=='(') { | |
arr.push(S[i]); | |
} else { | |
if(arr.length){ |
NewerOlder