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 | 29 | 30 | 31 |
Tags
- error
- 리덕스장바구니
- memory
- js to ts
- 타입스크립트
- Spring
- 프로그래머스
- codeup
- 토이프로젝트
- 코드업
- 스프링
- web
- Redux
- OS
- 백준
- 분할메모리할당
- 협업
- react-redux
- C++
- 자료구조
- 일상
- 알고리즘
- 공부
- Operating System
- CPU 스케줄링
- 정렬
- 기초100제
- Java
- 파이썬
- react
Archives
- Today
- Total
목록25501 (1)
감자튀김 공장🍟

✔ 문제 ✔ 풀이 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