전체 글

전체 글

    [python] 프로그래머스 > 귤고르기

    https://school.programmers.co.kr/learn/courses/30/lessons/138476 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 - 시간초과 def solution(k, tangerine): answer = 0 clSum = 0 cntList = [] for st in list(set(tangerine)): cntList.append(tangerine.count(st)) cntList.sort(reverse=True) for cl in cntList: clSum += cl answer += 1 if k

    [python] 프로그래머스 > 구명보트

    https://school.programmers.co.kr/learn/courses/30/lessons/42885 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 - 테케 일부 실패 def solution(people, limit): answer = 0 people.sort(reverse=True) if len(people) % 2 == 1: answer += 1 r = people.pop() for pp in people: if pp + r 3 와 같은 테스트 케이스에서는 실패하는 코드이다. 나의 풀이 - 성공 from collections i..

    [python] 프로그래머스 > 연속된 부분 수열의 합

    https://school.programmers.co.kr/learn/courses/30/lessons/178870 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 - 완전 틀림 from collections import deque def solution(sequence, k): temp = {} seqIndex = len(sequence) - 1 while seqIndex > -1: temp[seqIndex] = sequence[seqIndex] valSum = sum(temp.values()) if valSum == k: return [lis..

    [python] 프로그래머스 > 마법의 엘리베이터

    https://school.programmers.co.kr/learn/courses/30/lessons/148653 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 (코드실행에서만 통과) def solution(storey): answer = 0 for i in str(storey): if int(i) > 5: answer += (11 - int(i)) else: answer += int(i) return answer 주어진 예제케이스만 생각하였다. 이후 새로운 에제케이스를 찾았다. 646 -> 650 -> 700 -> 1000 => 13 나의 ..

    [python] 프로그래머스 > H-index

    https://school.programmers.co.kr/learn/courses/30/lessons/42747 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 def solution(citations): citations.sort() for index, i in enumerate(citations): if len(citations) - index == i: return i 문제 이해 후 나의 풀이 def solution(citations): citations.sort() for index, i in enumerate(citations): if..

    [python] 프로그래머스 > 이진변환반복하기

    https://school.programmers.co.kr/learn/courses/30/lessons/70129 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr 나의 풀이 def removeZero(val): removedZeroCnt = 0 for i in val: if i == '0': removedZeroCnt += 1 return removedZeroCnt, ''.join(val).replace('0', '') def transform(val): namosi = [] while val != 1: rest = val % 2 val = val // 2..

    [python] 프로그래머스 > 뒤에 있는 큰 수 찾기

    문제 https://school.programmers.co.kr/learn/courses/30/lessons/154539 프로그래머스 코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요. programmers.co.kr [나의풀이 1번째] - 시간초과 실패 from collections import deque def solution(numbers): answer = [] dqList = deque(numbers) for i in list(dqList): dqList.popleft() isExist = False for j in list(dqList): if j > i: answer.append(j) isE..

    [CCNA] CCNA1 - Chapter5

    What happens to runt frames received by a Cisco Ethernet switch? In an attempt to conserve bandwidth and not forward useless frames, Ethernet devices drop frames that are considered to be runt (less than 64 bytes) or jumbo (greater than 1500 bytes) frames. Ethernet frame The minimum Ethernet frame is 64 bytes. The maximum Ethernet frame is 1518 bytes. A network technician must know the minimum a..