Netskope Interview Question

2 leetcode medium question on stack and hashmap based