Skip to content

Instantly share code, notes, and snippets.

@kusold
Created November 20, 2012 03:47
Show Gist options
  • Save kusold/4115820 to your computer and use it in GitHub Desktop.
Save kusold/4115820 to your computer and use it in GitHub Desktop.
STRSTR Fasta
string = "foobarfoofoobarbar"
list_of_dupes = []
for(int i = string.length; i > 1; i--)
{
slice_size = string.length / i;
temp_string = string
slice_to_check_for_uniqueness = temp_string.slice(FROM 0, TO slice_size); #I'm assuming slice consumes.
while(temp_string.contains(slice_to_check_for_uniqueness) != null)
{
list_of_dupes.add(slice_to_check_for_uniqueness);
temp_string.remove(slice_to_check_for_uniqueness);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment