Never give up
블로그 이미지

Home

Write

Setting

About Me

  • 분류 전체보기 (58)
    • Computer vision (1)
      • Detection (1)
      • Segmentation (1)
      • Depth estimation (1)
      • Technique (0)
    • Programming (40)
      • Pytorch (2)
      • Python (2)
      • Linux (1)
      • (Dev|ML)OPS (0)
      • C++ (5)
      • 님들은 삽질하지 마세요 (18)
      • 코딩테스트 (2)
      • Why (1)
      • AI development (8)
      • DB (0)
    • 기본기 (3)
      • 딥러닝 관련 수학 (0)
      • 프로그래밍 (2)
    • 잡설 (6)
    • Data Insight (5)
no image
[프로그래머스] 영어 끝말잇기
def solution(n, words): pos = [0 for _ in range(n)] pos[0] = 1 lst = set([words[0]]) for i in range(1, len(words)): pos[i % n] += 1 if words[i-1][-1] != words[i][0]: return (i % n) +1, pos[i%n] elif words[i] not in lst: lst.add(words[i]) else: return (i % n) +1, pos[i%n] return [0,0] 나는 position을 행렬을 만들어서 식을 넣었지만 몫을 계산해서 몇번째 행인지 알 수 있음 def solution(n, words): for p in range(1, len(words)): if wo..
2024.03.24
Programming/코딩테스트
no image
[프로그래머스] 연속 부분 수열 합의 개수
def over_coverage(idx , max_len): if idx > max_len: additional_idx = idx-max_len return additional_idx else: return None def calculate(start, end , elements): # print(start, end) additional_idx = over_coverage(end, len(elements)) if additional_idx: result = sum(elements[start:end])+sum(elements[:additional_idx]) else: result = sum(elements[start:end]) return result def solution(elements): answer..
2024.03.24
Programming/코딩테스트
Prev 1 Next
uTube· Designed By ushin20

티스토리툴바