Skip to content

Instantly share code, notes, and snippets.

View aliwo's full-sized avatar
🏠
Working from home

정승원 aliwo

🏠
Working from home
View GitHub Profile
solution = lambda t, l = []: max(l) if not t else solution(t[1:], [max(x,y)+z for x,y,z in zip([0]+l, l+[0], t[0])])
package buv.co.kr.util.youtube;/*
* Copyright (c) 2012 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
def alter_alpha(to):
num = ord(to)
return num - 65 if num < 79 else 90 - num + 1
def traverse(done, i):
# TODO ; left_cnt 보다 right_cnt 가 크면 right 탐색을 중단 하는 최적화가 가능할까? 답에 영향이 없을까?
# 기저 사례
if False not in done:
@aliwo
aliwo / sums.py
Created May 25, 2019 13:11
재귀호출 sum 과 분할정복 sum
import dis
def recursive_sum(n):
print('recursive 호출', n)
if n == 1:
return 1
return n + recursive_sum(n-1)
@aliwo
aliwo / holleywood.py
Last active May 24, 2019 03:15
할리우드 법칙
class Mother:
my_varialbe = 3
def _func(self):
print('func 호출')
def func_caller(self):
print('여기에 로그를 쓰면 됩니다: {}'.format(self.my_variable))
self.func()
@aliwo
aliwo / hi.py
Last active February 15, 2019 12:17
가위바위보!
# hi