문제 풀이/프로그래머스2 [프로그래머스/파이썬] 영어 끝말잇기 https://school.programmers.co.kr/learn/courses/30/lessons/12981# 프로그래머스코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.programmers.co.kr [문제 규칙]1. 한글자 단어는 탈락. 단어의 길이는 2글자 이상이어야 함2. 바로 앞사람의 단어 마지막 문자랑 이어져야함. (끝말잇기 원칙과 같음)3. 이미 나왔던 단어 말하면 탈락. [Wrong]def solution(n, words): for i in range(len(words)): if len(words[i])==1: return [(i%n)+1,(i/.. 2024. 6. 28. [프로그래머스] 문자열 다루기 기본, 파이썬 isdigit [해결]def solution(s): if len(s)==4 or len(s)==6: for ch in s: if ch'9': answer=False return answer else: answer=True else: answer=False[해결2]def solution(s): if len(s)==4 or len(s)==6: answer=s.isdigit() else: answer=False return answer + 알아두면 좋은str.isdigit() : 문자열이 숫자로만 이루어져있는지 확인할때 .. 2024. 6. 26. 이전 1 다음