반응형 분류 전체보기128 [DSA][Two Pointers] 01. Valid Palindrome LeetCode 125 01. Valid PalindromeA phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward.Alphanumeric characters include letters and numbers.Given a string s, return true if it is a palindrome, or false otherwise. [질문하기]- 숫자도 valid 한 문자인가요? → Alphanumeric에 해당하는 집합에 대한 정확한 정의 .. 2025. 6. 2. [DSA][Stack] 06. Largest Rectangle In Histogram LeetCode 84 06. Largest Rectangle In HistogramGiven an array of integers heights representing the histogram's bar height where the width of each bar is 1,return the area of the largest rectangle in the histogram. [질문하기]- 입력 배열이 비어있거나 height이 0일 수도 있나요?- 히스토그램의 직사각형을 어떻게 정의하나요? [아이디어]- 더 작은 높이가 나오면 확장할 수 없으므로 직사각형의 넓이를 계산하고, 더 높은 높이가 나오면 확장할 수 있으므로 stack에 쌓자. [풀이 1] Stackclass Solution: def.. 2025. 6. 1. [DSA][Stack] 05. Car Fleet LeetCode 853 05. Car FleetThere are n cars at given miles away from the starting mile 0, traveling to reach the mile target.You are given two integer array position and speed, both of length n, where position[i] is the starting mile of the ith car and speed[i] is the speed of the ith car in miles per hour.A car cannot pass another car, but it can catch up and then travel next to it at the speed .. 2025. 5. 31. [DSA][Stack] 04. Daily Temperatures LeetCode 739 04. Daily TemperaturesGiven an array of integers temperatures represents the daily temperatures,return an array answer such that answer[i] is the number of days you 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. [질문하기]- 현재 온도와 같은 날도 더 따뜻한 날로 간주되나요, 아니면 strictly 따뜻한 날만 해당되나요? [아이디어]- stac.. 2025. 5. 28. 이전 1 ··· 18 19 20 21 22 23 24 ··· 32 다음