- 0000 0
- 0001 1
- 0010 2
- 0011 3
- 0100 4
- 0101 5
- 0110 6
- 0111 7
- 1000 8
- 1001 9
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
# Input data | |
list_0 = [1, 3, 6, 7, 8, 9, 10, 2, 3, 4] | |
list_1 = [12, 56, 3, 78, 34, 56, 2, 10] | |
list_2 = [123, 567, 234, 890] | |
list_3 = [5, 7, 8, 9, 3, -2, -4, -2, 5, 6, 8, 11, 2] | |
# Iterative algorithm | |
def maximum(L): | |
biggest_item = L[0] | |
for item in L: |
BOB\0
42 4F 42 00
0100 0010 0100 1111 0100 0010 0000 0000
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
BILLS = [200, 100, 50, 20, 10] | |
amount = 60 | |
i = 0 | |
while amount > 0: | |
BILLS[i] | |
... | |
... | |
print("Finish") |
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
# fac(1) = 1 | |
# fac(n) = n * fac(n - 1) | |
def fac(n): | |
if n == 1: | |
return 1 | |
return n * fac(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
# fibo(0) = 0 | |
# fibo(1) = 1 | |
# fibo(n) = fibo(n-1) + fibo(n-2) | |
# ALGO | |
def fibo(n): | |
if n == 0: | |
return 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
# fibo(0) = 0 | |
# fibo(1) = 1 | |
# fibo(n) = fibo(n-1) + fibo(n-2) | |
# ALGO | |
def fibo(n): | |
a, b = 0, 1 | |
for _ in range(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
#! /bin/sh -x | |
language='javascript' | |
# Get x-common repository | |
git clone https://github.com/exercism/x-common/ | |
cd x-common | |
git pull origin master | |
cd .. | |
# Get x$language repository | |
git clone "https://github.com/exercism/x$language/" | |
cd "x$language" |
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 ma_super_function(n): | |
print("start", n) | |
if n > 0: | |
ma_super_function(n - 1) | |
print("end", n) | |
ma_super_function(10) | |
# CPU |
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
#include "unistd.h" | |
#include "stdlib.h" | |
#include "stdio.h" | |
int main(void) { | |
char* key = malloc(sizeof(char) * 20); | |
key = "cookie"; | |
for (char i = 0; i < 20; ++i) { | |
printf("[%c]", key[i]); | |
} |