728x90

파이썬 23

[프로그래머스] level2 카펫 - 파이썬(Python) 풀이

문제 코딩테스트 연습 - 카펫 Leo는 카펫을 사러 갔다가 아래 그림과 같이 중앙에는 노란색으로 칠해져 있고 테두리 1줄은 갈색으로 칠해져 있는 격자 모양 카펫을 봤습니다. Leo는 집으로 돌아와서 아까 본 카펫의 노란색과 �� programmers.co.kr 코드 # 2,3,8,9,10 실패 answer = [] for i in range(1, yellow+1): if 2 * (int(yellow / i) + 2) + (i * 2) == brown: answer = [int(yellow/i+2) ,i+2] break answer def solution(brown, yellow): answer = [] for i in range(1, yellow+1): if yellow / i == int(yellow ..

코딩코딩 2020.09.13

[Python] 분산 분석(ANOVA) : feat.크루스칼-왈리스 순위합 검정- (2)

이전 게시물에 이어서 만약 등분산이었을 때의 분산분석을 해보자. stats.f_oneway(iris.loc[iris.species == "setosa", "petal_length"], iris.loc[iris.species == "versicolor", "petal_length"], iris.loc[iris.species == "virginica", "petal_length"]) ------------------------------------------------------------------------- F_onewayResult(statistic=1180.161182252981, pvalue=2.8567766109615584e-91) 등분산 일 때의 분산분석은 stats.f_oneway() 를 사..

[프로그래머스] level2 스킬 트리

문제 코딩테스트 연습 - 스킬트리 programmers.co.kr 코드 def search(a,b): c = list(b) d = 1 for i in range(len(c)-1,-1,-1): if(c[i] not in a): del c[i] if(len(c) == 0): d = 1 else: for i in range(len(c)): if(c[i] != a[i]): d = 0 return d def solution(skill, skill_trees): answer = 0; skill = list(skill) for i in range(len(skill_trees)): answer += search(skill,skill_trees[i]) return answer 코드풀이 skill : 선행되야 할 스킬 s..

코딩코딩 2020.09.09