dsa1 min read
Baseball Game — Stack Simulation
Simulate a baseball scoring game using a stack to track valid scores and handle +, D, and C operations.
Read →
webcoderspeed.com
1276 articles
Simulate a baseball scoring game using a stack to track valid scores and handle +, D, and C operations.
Compare two strings after applying backspace characters in O(1) space by scanning from right with skip counters.
Track the minimum number of operations to return to the main folder by simulating directory navigation with a depth counter.
Count ping requests within the last 3000ms using a queue that slides expired entries off the front.
Remove adjacent pairs of same letters with different cases using a stack to build the result character by character.