목록스택 (20)
넘치게 채우기
https://leetcode.com/problems/remove-nodes-from-linked-list/description/leetcode - Remove Nodes From Linked List문제 유형 : 연결 리스트, 재귀, 스택문제 난이도 : Medium 문제You are given the head of a linked list.Remove every node which has a node with a greater value anywhere to the right side of it.Return the head of the modified linked list. 연결리스트의 head가 주어진다.노드의 다음 노드들 중 더 큰 값이 있다면, 그 노드를 삭제하라.모든 작업이 끝나고 나서의 연결 ..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/DLgl2/btsGBRuuDau/3VGkIZVHkY6vPASkSbr0z0/img.png)
https://leetcode.com/problems/maximal-rectangle/description/ Leetcode - Maximal Rectangle 문제 유형 : 히스토그램, 스택, 다이나믹 프로그래밍 문제 난이도 : Hard 문제 Given a rows x cols binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area. rows x cols크기의 이진 행렬이 주어진다. 1로만 이루어진 가장 큰 직사각형을 찾아서 그 크기를 반환하시오. 풀이 풀이 1: 다이나믹 프로그래밍(동적계획법) 처음에는 각 자리별로 1로 이어진 왼쪽 끝과 위쪽 끝을 구한 뒤, 크기를 일..
https://leetcode.com/problems/remove-k-digits/description/ Leetcode - Remove K Digits 문제 유형 : 스택 문제 난이도 : Medium 문제 Given string num representing a non-negative integer num, and an integer k, return the smallest possible integer after removing k digits from num. 양의정수를 표현하는 문자열 num이 주어집니다. num에서 k개의 정수를 제거한 가장 작은 수를 구하시오. 풀이 스택을 이용하여 풀 수 있다. 수를 하나씩 스택에 담는다. 만약에 이번에 넣을 수보다 큰 수들이 있다면, 그 수들은 기존 스택에서..
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/oJMm2/btsGuJ5aGX2/n8KDjm0C44zidJRuzIS08k/img.png)
https://leetcode.com/problems/reveal-cards-in-increasing-order/description/ Leetcode - Reveal Cards In Increasing Order 문제 유형 : 스택, 큐 문제 난이도 : Medium 문제 You are given an integer array deck. There is a deck of cards where every card has a unique integer. The integer on the ith card is deck[i]. You can order the deck in any order you want. Initially, all the cards start face down (unrevealed) in o..
https://leetcode.com/problems/number-of-students-unable-to-eat-lunch/description/ Leetcode - Number of Students Unable to Eat Lunch 문제 유형 : 스택, 큐 문제 난이도 : Easy 문제 The school cafeteria offers circular and square sandwiches at lunch break, referred to by numbers 0 and 1 respectively. All students stand in a queue. Each student either prefers square or circular sandwiches. The number of sandwiches ..
https://leetcode.com/problems/valid-parenthesis-string/submissions/1225282138/ Leetcode - Valid Parenthesis String 문제 유형 : 문자열 처리, 스택 문제 난이도 : Medium 문제 Given a string s containing only three types of characters: '(', ')' and '*', return true if s is valid. The following rules define a valid string: Any left parenthesis '(' must have a corresponding right parenthesis ')'. Any right parenthesis '..
https://leetcode.com/problems/minimum-remove-to-make-valid-parentheses/description/ Leetcode - Minimum Remove to Make Valid Parentheses 문제 유형 : 문자열 처리 / 스택 문제 난이도 : Medium 문제 Given a string s of '(' , ')' and lowercase English characters. Your task is to remove the minimum number of parentheses ( '(' or ')', in any positions ) so that the resulting parentheses string is valid and return any vali..
https://leetcode.com/problems/reorder-list/description/ Leetcode - Reorder List 문제 유형 : 연결리스트, 스택 문제 난이도 : Medium 문제 You are given the head of a singly linked-list. The list can be represented as: L0 → L1 → … → Ln - 1 → Ln Reorder the list to be on the following form: L0 → Ln → L1 → Ln - 1 → L2 → Ln - 2 → … You may not modify the values in the list's nodes. Only nodes themselves may be changed. ..
https://leetcode.com/problems/daily-temperatures/description/?envType=daily-question&envId=2024-01-31 LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com LeetCode - Daily Temperatures 문제 유형 : 스택, 모노토닉 스택 문제 난이도 : Medium 문제 Give..
https://leetcode.com/problems/evaluate-reverse-polish-notation/description/?envType=daily-question&envId=2024-01-30 LeetCode - The World's Leading Online Programming Learning Platform Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com LeetCode - Evaluate Reverse Polish Notation 문제 유형 : 스택, 후위표..