코딩테스트 5

프로그래머스 - 바탕화면 정리 - Level 1

https://school.programmers.co.kr/learn/courses/30/lessons/161990 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr def solution(wallpaper): minxCnt=len(wallpaper) maxxCnt=0 minyCnt=len(wallpaper[0]) maxyCnt=0 for i,line in enumerate(wallpaper): for j,box in enumerate(line): if(box=="#"): minxCnt=min(minxCnt,i) maxxCnt=max(maxxCnt,i) mi..

코딩테스트 2023.03.08

백준 11059 크리 문자열 파이썬

https://www.acmicpc.net/problem/11059 11059번: 크리 문자열 첫째 줄에 문자열 S가 주어진다. S는 숫자로만 이루어져 있으며, 길이는 1,000을 넘지 않는다. 항상 크리 문자열이 존재하는 입력만 주어진다. www.acmicpc.net num = input() if(len(num)%2==0): firstLen = len(num) else: firstLen = (len(num)-1) answer=0 Bool=True while Bool==True: if(firstLen==2): answer=2 break for i in range(0,len(num)-firstLen+1): cnt1=0 cnt2=0 for j in range(i,i+firstLen//2): cnt1+=int..

코딩테스트 2023.01.24

프로그래머스 2차원으로 만들기 파이썬

출처:https://school.programmers.co.kr/learn/courses/30/lessons/120842 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr def solution(num_list, n): answer = [[] for i in range(len(num_list)//n)] cnt=0 cnt2=0 for i in range(len(num_list)): answer[cnt].append(num_list[i]) cnt2+=1 if(cnt2==n): cnt+=1 cnt2=0 return answer

코딩테스트 2022.12.24

프로그래머스 모스부호(1) 파이썬

출처 https://school.programmers.co.kr/learn/courses/30/lessons/120838 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr def solution(letter): morse = { '.-':'a','-...':'b','-.-.':'c','-..':'d','.':'e','..-.':'f', '--.':'g','....':'h','..':'i','.---':'j','-.-':'k','.-..':'l', '--':'m','-.':'n','---':'o','.--.':'p','--.-':'q','.-.':'r', '...

코딩테스트 2022.12.17