This file contains hidden or 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
#!/usr/bin/env python3 | |
import unittest | |
def merge(a, b): | |
"""Merge 2 strings containing unique items into one final string | |
containing the same unique items. This tries to preserve the order | |
of the two lists if possible, but will prefer the order of the | |
second list if they disagree. New items will also appear after older |
This file contains hidden or 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 <limits> | |
struct Nil { | |
typedef int type; | |
}; | |
template <int V, class L = Nil, class R = Nil> struct BTree { | |
typedef decltype(V) type; | |
static const type value = V; | |
typedef L left; |
This file contains hidden or 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
unbindall | |
// Affichage | |
//______________________________________ | |
seta r_primitives "0" | |
seta r_railSegmentLength "0" | |
seta r_railCoreWidth "1" | |
seta r_railWidth "1" |
This file contains hidden or 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
/* | |
* Reads a word from standard input, and write the biggest palindrome it can | |
* from that word and only by removing letters. | |
* E.g. Biggest palindrome for "baobab" is "babab" (removing the "o"). | |
* | |
* This is implemented using dynamic programming, that is searching the | |
* longest common subsequence (O(n²) time and space complexity) between the word, | |
* and it's reverse: | |
* i.e. LCS between "baobab" and "baboab" | |
*/ |
This file contains hidden or 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 <assert.h> | |
#include <limits.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
struct node { | |
struct node *left, *right, *parent; | |
int value; | |
}; |