archives

  • 홈
  • 태그
  • 미디어로그
  • 위치로그
  • 방명록

2020/05/12 1

leetcode 560(구현?), 937(구현), 54(달팽이), 59(달팽이)

560 https://leetcode.com/problems/subarray-sum-equals-k/ 딕셔너리에 https://leetcode.com/problems/two-sum/ 문제를 풀때처럼 이전까지의 합을 저장해놓는다. 그리고 현재까지의 총합 - k가 딕셔너리에 있으면 이 값은 이전 어디선가 만들어질수 있다는 뜻이므로 그만큼 +를 해준다. 그게 아니면 해당 수가 만들어질 경우의 수를 딕셔너리에 저장해준다. class Solution(object): def subarraySum(self, nums, k): d = {} d[0] = 1 total = 0 ret = 0 for i in xrange(len(nums)): total += nums[i] if total - k in d: ret += d[t..

algorithm/problem solving 2020.05.12
1
더보기
프로필사진

프로그래밍 좋아합니다. 자료 퍼가실때는 참조만 적어주세요..

  • study (975)
    • setting, git, shell etc (21)
    • machine learning, image (27)
    • data engineering (94)
    • Python (140)
      • 2.7 information (74)
      • 2.7 simple coding(+ c++) (42)
      • 2.7 for fun. (24)
    • web (27)
      • back + front (22)
      • etc (5)
      • kotlin (0)
    • algorithm (210)
      • theory (51)
      • problem solving (159)
    • webhacking (180)
      • sql, sql injection (98)
      • client (28)
      • etc (54)
    • systemhacking (34)
      • practice (25)
      • background (9)
    • private (241)
      • 면접 (0)
      • memo (56)
      • Vancouver diary (77)
      • business trip (10)
      • normal diary (81)
      • English (17)

Tag

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2020/05   »
일 월 화 수 목 금 토
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31

방문자수Total

  • Today :
  • Yesterday :

Copyright © Kakao Corp. All rights reserved.

  • Hide
  • 지훈현서님 (python developer)
  • 백준 온라인 저지 블로그.(매우 유용)

티스토리툴바