Stack

[Sidenote/JS] Using Stack for Maximum Efficiency

Koowoy
Solution Reference: https://programmers.co.kr/questions/17409 Task https://programmers.co.kr/learn/courses/30/lessons/12973 Given a string of characters, if two of the same alphabet in a row is to be deleted until there is none left, check if this possible with the given string. Solution function solution(s) { // Split string into array let arr = s.split(''); // Set temporary stack array let temp = []; // If string length is odd number, return 0 if (arr.

TIL - CS50x Week 5 Data Structure

Koowoy
Until this lesson, the term “data structure” reminded me only of the “data types” that variables can have. But I learned that data structure rather referred to how multiple data is stored and accessed in different methods. Array Though I’ve used arrays in so many different languages, since there were a lot of simplification applied to the arrays in Javascript and Python, I only came to know of the restrictions that arrays have.