I hereby claim:
- I am zedr on github.
- I am rdiscala (https://keybase.io/rdiscala) on keybase.
- I have a public key whose fingerprint is 5357 3892 0117 DAB1 FE13 2778 7F60 DF87 BBC5 0EEB
To claim this, I am signing this object:
# Given an list of random numbers, push all the zeroes to the end of the list. | |
# For example, if the given list is [1, 9, 8, 4, 0, 0, 2, 7, 0, 6, 0], | |
# it should be changed to [1, 9, 8, 4, 2, 7, 6, 0, 0, 0, 0]. | |
# Time complexity should be O(n). | |
def order(arr): | |
idx = 0 | |
ldx = len(arr) - 1 | |
while idx < ldx: | |
a = arr[idx] |
# Complexity: O(n^2) | |
def sort(arr): | |
l = len(arr) | |
if l > 1: | |
for ldx in range(l): | |
idx = ldx - 1 | |
key = arr[ldx] | |
while idx > -1 and arr[idx] > key: | |
arr[idx + 1] = arr[idx] |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
def merge(arr1, arr2): | |
idx = ldx = 0 | |
l1 = len(arr1) | |
l2 = len(arr2) | |
tmp = [] | |
while idx < l1 and ldx < l2: |
#!/usr/bin/env python | |
class Node(object): | |
def __init__(self, value, next_=None): | |
self.value = value | |
self.next_ = next_ | |
def __repr__(self): | |
return "Node({0}, {1})".format(self.value, self.next_) |
""" | |
Slack chat-bot Lambda handler. | |
""" | |
import os | |
import logging | |
import urllib | |
# Grab the Bot OAuth token from the environment. | |
BOT_TOKEN = os.environ["BOT_TOKEN"] |
:nnoremap <CR> :!make && ./main<CR> |
import tornado.web | |
import tornado.ioloop | |
from tornado.options import define, options | |
define('port', default=45000, help='try running on a given port', type=int) | |
def fib(): | |
a, b = 1, 1 | |
while True: | |
yield a |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python | |
from __future__ import print_function, unicode_literals | |
import six | |
import json | |
import argparse | |
from collections import defaultdict | |
from six.moves.urllib.parse import urlencode, urlparse |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
int | |
count_bits(int n) | |
{ | |
int l, c; | |
l = 0; | |
c = 0; |