This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html, body { | |
font-family: 'Roboto', 'Helvetica', sans-serif; | |
} | |
main, #messages-card { | |
height: 100%; | |
padding-bottom: 0; | |
} | |
#messages-card-container { | |
height: calc(100% - 35px); | |
padding-bottom: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var dom = Bloop.dom; | |
var Box = Bloop.createClass({ | |
getInitialState: function() { | |
return { number: 0 }; | |
}, | |
updateNumber: function() { | |
this.state.number++; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(for [c clusters | |
:let [cluster-by-years (apply map vector c)]] | |
(for [cluster-year cluster-by-years | |
:let [cluster-year (remove nil? cluster-year)]] | |
;; median function here | |
(apply + cluster-year))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def fib-primes | |
;; There is a good chance that there are infinitely many prime numbers. | |
;; We only concern ourselves with fibonacci prime that can be | |
;; expressed in 64-bit integer values. | |
;; source: http://oeis.org/A005478 | |
#{2 3 5 13 89 233 1597 28657 514229 433494437 2971215073 99194853094755497}) | |
(defn fizz-buzz-fizz | |
"Generates first n Fibonacci number where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NumArray(object): | |
def __init__(self, nums): | |
""" | |
initialize your data structure here. | |
:type nums: List[int] | |
""" | |
self.sums = [0] | |
sum = 0 | |
for i, n in enumerate(nums): | |
sum += n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution(object): | |
def numTrees(self, n): | |
""" | |
:type n: int | |
:rtype: int | |
""" | |
if n < 2: | |
return 1 | |
dp = [0] * (n+1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution(object): | |
def findItinerary(self, tickets): | |
""" | |
:type tickets: List[List[str]] | |
:rtype: List[str] | |
""" | |
adjs = {} | |
for start, end in tickets: | |
if start in adjs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution(object): | |
def getIntersectionNode(self, headA, headB): | |
""" | |
:type head1, head1: ListNode | |
:rtype: ListNode | |
""" | |
def list_len(head): | |
n = 0 | |
while head: | |
head = head.next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution(object): | |
def isUgly(self, num): | |
""" | |
:type num: int | |
:rtype: bool | |
""" | |
if num == 0: | |
return False | |
uglies = [2,3,5] | |
for ugly in uglies: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution(object): | |
def isUgly(self, num): | |
""" | |
:type num: int | |
:rtype: bool | |
""" | |
if num == 0: | |
return False | |
uglies = [2,3,5] | |
for ugly in uglies: |
NewerOlder