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
- 1000개 이상
- docker airflow
- 공백null치환
- Glue
- GCP mysql
- 파이써닉
- python
- 답안지표기잘못한느낌...
- 데이터카탈로그
- 파이서닉
- airflow설치
- import from 차이점
- Binary_gap
- Codility
- 도커 에어플로
- 차이
- docker
- 프로그래머스
- s3목록
- cyclerotation
- docker-compose
- 맞출수있었는데...
- AWS
- 코테
- 공백트림
- 디비설치
- 코딩테스트
- 공백Trim
- 이직 3개월차
- Glue의 두 가지 핵심 기능
Archives
- Today
- Total
작은하마
[codility] longest_password 본문
https://app.codility.com/programmers/trainings/1/longest_password/
LongestPassword coding task - Practice Coding - Codility
Given a string containing words, find the longest word that satisfies specific conditions.
app.codility.com
이문제는 isalnum()의 사용과 문자, 숫자 추출을 가능케하는 re.findall을 이용하면 쉽게 풀 수 있었다.
문론 나보다 잘 푸는 사람도 많다.
import re
s='te$##st 5 a0A pass007 ?xy1'
s=s.split(' ')
max=-1
for i in s:
if i.isalnum()==False:
continue
if len(re.findall("\d",i))%2==1 and len(re.findall("[a-zA-Z]",i))%2==0:
if len(i)>max:
max=len(i)
max
'코딩테스트 > Codility' 카테고리의 다른 글
[Codility] odd occurrences in array (0) | 2021.07.23 |
---|---|
[codility]디버깅문제 (0) | 2021.07.22 |
[codility] 합이 같은 수 (0) | 2021.07.22 |
[Codility] CyclicRotation (0) | 2021.07.21 |
[codility] BinaryGap (0) | 2021.07.20 |
Comments