Skip to content

Instantly share code, notes, and snippets.

View lee101's full-sized avatar

Lee Penkman lee101

View GitHub Profile
@lee101
lee101 / designer.html
Created October 30, 2014 04:15
designer
<link rel="import" href="../code-mirror/code-mirror.html">
<link rel="import" href="../core-drawer-panel/core-drawer-panel.html">
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-menu/core-submenu.html">
@lee101
lee101 / subsum_test.py
Last active August 29, 2015 14:07
maximum contiguous subsequence sum
# a contiguous sub-sequence is a sequence taken by starting at a start point and taking everything until an end point.
# e.g the sequence [1, 2, 3] has sub sequences [], [1], [2], [3], [1, 2], [2, 3] and [1, 2, 3]
# Given a list of numbers, return the contiguous sub-sequence which has the largest sum (add up all of the numbers)
# eg [1, 2, 3] -> [1, 2, 3]
# [1, -2, 3] -> [3]
# [2, -1, 3] -> [2, -1, 3]
# [-1, 1, 1, 2, -1, 2, -5] -> [1, 1, 2, -1, 2]
# Gotchas:
@lee101
lee101 / can_balance
Last active August 29, 2015 14:07
Partition problem
# We have some rocks represented as numbers (weights of the rocks)
# We want to know if its possible to balance scales using all of our rocks.
# Given a list of numbers,
# return if it is possible to partition the numbers into two sets with equal sums,
# where a number has to be in either one or the other set.
# eg
# [10, 10] -> True