일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- React 고급안내서
- background setttimeout
- React 고급 안내서
- Next13
- hook
- React 18 Nextjs
- Babel
- react
- React 18
- Programmers
- background tab
- background: url
- React 공식문서
- context
- Nextjs React 18
- Render Props
- background setInterval
- RTK Query
- getUTCDate
- codingtest
- next13 head
- notFound()
- 고급안내서
- react-helmet
- Nextjs
- react hook
- React API 참고서
- Javascript
- React18
- CSS
Archives
- Today
- Total
목록짝지어 제거하기 (1)
akjfal
[Programmers] 짝지어 제거하기
import java.util.Stack; class Solution{ public int solution(String s){ int answer = 1; int length = s.length(); Stack stack = new Stack(); stack.push(s.charAt(0)); int idx = 1; while(idx < length){ char alpha = s.charAt(idx); if(stack.isEmpty()){ stack.push(alpha); }else if(alpha == stack.peek()){ stack.pop(); }else{ stack.push(alpha); } idx++; } if(!stack.isEmpty()) answer = 0; return answer; }..
알고리즘/programmers
2021. 6. 24. 11:46