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
- 소프티어
- Typescript
- softeer
- level3
- 문자열
- level 3
- SQL 고득점 KIT
- Lv. 2
- 스택
- 자바스크립트
- DP
- Stack
- Java
- javascript
- 너비 우선 탐색
- programmers
- 다이나믹프로그래밍
- 프로그래머스
- Lv. 1
- 파이썬
- group by
- Lv. 3
- Lv. 0
- Dynamic Programming
- C언어
- dfs
- 브루트포스
- bfs
- Python
- 타입스크립트
Archives
- Today
- Total
목록시저 암호 (1)
몸과 마음이 건전한 SW 개발자
프로그래머스 Lv. 1 시저 암호 Python
문제 링크 https://school.programmers.co.kr/tryouts/72052/challenges 정답 코드 def solution(s, n): answer = '' # print(ord("a"), ord("z")) 97 122 # print(ord("A"), ord("Z")) 65 90 for a in s: if a == " ": answer += " " else: if a.isupper(): location = (ord(a) - 65 + n) % 26 + 65 answer += chr(location) else: location = (ord(a) - 97 + n) % 26 + 97 answer += chr(location) return answer 풀이 방법 - ord와 chr 활용 ..
알고리즘
2024. 1. 4. 00:01