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 <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
typedef enum { | |
INST_PUSH, | |
INST_ADD, | |
INST_PRINT | |
} Inst_Type; |
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
#!/usr/bin/env python3 | |
import functools | |
#Levenshtein Distance algorithm gives you the number of actions to perform to modify s1 to s2 | |
# Classic implementation of Levenshtein Distance algoritm (recursive) | |
@functools.lru_cache(maxsize=None) | |
def lev_ref(s1, s2): | |
if len(s1) == 0: return len(s2) |