Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 타입스크립트
- codeup
- memory
- 알고리즘
- error
- 기초100제
- Redux
- 토이프로젝트
- 협업
- 파이썬
- 분할메모리할당
- 코드업
- react-redux
- 자료구조
- 리덕스장바구니
- C++
- 일상
- js to ts
- OS
- Operating System
- 프로그래머스
- 공부
- 스프링
- Java
- Spring
- 정렬
- 백준
- web
- CPU 스케줄링
- react
Archives
- Today
- Total
목록25501 (1)
감자튀김 공장🍟
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/39hSC/btrRMAo1Neu/EHXxQFH9uV891EMAHiJyEK/img.png)
✔ 문제 ✔ 풀이 import sys input = sys.stdin.readline n = int(input()) def recursion(s, l, r): global count count += 1 if l >= r: return 1 elif s[l] != s[r]: return 0 else: return recursion(s, l+1, r-1) def isPalindrome(s): return recursion(s, 0, len(s)-1) for i in range(n): count = 0 print(isPalindrome(input().rstrip()), count) ✔ 후기 재귀 코드는 문제에서 주어졌으니 구해야하는 것은 함수가 재귀된 값을 구하는 것인데 global을 사용해 count를 전역 ..
Algorithm/BOJ
2022. 11. 21. 22:00