Stack
How do I make an stack?
What is a stack? How do you make a stack? This script and codes were developed by Maria on 14 October 2022, Friday.
Stack - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Stack</title>
</head>
<body> <script src="js/index.js"></script>
</body>
</html>
Stack - Script Codes JS Codes
function x(str){ var result = true; var left = "{[(".split(""); var right = "}])".split(""); // console.log(left); var stack = []; for(x of str){ switch(x){ case left[0]: j(1); break; case left[1]: j(2); break; case left[2]: j(3); break; case right[0]: j(-1); break; case right[1]: j(-2); break; case right[2]: j(-3); break; } } function j(n) { if (n > 0) { stack.push(n); } else if (n < 0) { if (stack[stack.length - 1] + n === 0) { stack.pop(); } else { result = false; } } } if (stack.length) { return false } else { return result; }
}
var str = "(())bbc(bb{}";
console.log(x(str));
Developer | Maria |
Username | tmaria |
Uploaded | October 14, 2022 |
Rating | 3 |
Size | 1,571 Kb |
Views | 10,120 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Simple Username and Password Check in JS | 2,686 Kb |
Fibonacci | 1,923 Kb |
JSON Practice | 2,959 Kb |
Count occurances | 1,648 Kb |
Exercise | 1,580 Kb |
Pyramid | 1,409 Kb |
ArrayPractice | 1,673 Kb |
A Pen by Maria | 7,159 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Savemedia1.1 | EdsonAlcala | 2,148 Kb |
Fun animations with CSS3 | Minimalmonkey | 2,360 Kb |
A Pen by Bryan Rojas | Bryanrojas | 1,873 Kb |
Banner Ad | Raquellorenzana | 4,172 Kb |
Parallax-ish Sliding Content | Jdsteinbach | 2,748 Kb |
Siema - add pagination to prototype | Pawelgrzybek | 2,575 Kb |
Playing with FlexBox | _Billy_Brown | 3,162 Kb |
Testing Portfolio Page | Sideshowli | 3,395 Kb |
Animated Donut Chart | Jplhomer | 3,808 Kb |
3D-box | Parthviroja | 2,346 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!