스택(Stack):먼저 들어간 데이터가 나중에 나오는 단순한 규칙을 가지고 있는 리스트 / 후입선출(Last In First Out) Java에서 Stack과 ArrayDeque: Java에는 Stack이란 클래스가 존재하지만, Stack을 구현할 때 아래와 같은 이유로 ArrayDeque를 일반적으로 사용A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations, such as ArrayDequeJava SE 21 기준 Stack 클래스 공식 문서 발췌 → 더 완전하고 일관된 스택(LIFO) 동작은 Deque 인터페이스와 그 구현체 (ArrayDequ..
문제Given an array of integers temperatures represents the daily temperatures,return an array answer such that answer[i] is the number of daysyou have to wait after the ith day to get a warmer temperature.If there is no future day for which this is possible, keep answer[i] == 0 instead. 코드import java.util.ArrayDeque;import java.util.Deque;class Solution { public int[] dailyTemperatures(int[] te..
문제Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.An input string is valid if:Open brackets must be closed by the same type of brackets.Open brackets must be closed in the correct order.Every close bracket has a corresponding open bracket of the same type. 코드import java.util.ArrayDeque;import java.util.Deque;class Solution {..