How to use the algorithms.string.String.advanced_anagrams function in algorithms

To help you get started, we’ve selected a few algorithms examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stunstunstun / python-algorithms / tests / test_string.py View on Github external
self.assertEqual(String.advanced_anagrams('mnop'), 2)
        self.assertEqual(String.advanced_anagrams('xyyx'), 0)
        self.assertEqual(String.advanced_anagrams('xaxbbbxx'), 1)
        self.assertEqual(String.advanced_anagrams('xaxbbbxa'), 1)
        self.assertEqual(String.advanced_anagrams('abxxabbx'), 1)

        self.assertEqual(String.advanced_anagrams('hhpddlnnsjfoyxpciioigvjqzfbpllssuj'), 10)
        self.assertEqual(String.advanced_anagrams('xulkowreuowzxgnhmiqekxhzistdocbnyozmnqthhpievvlj'), 13)
        self.assertEqual(String.advanced_anagrams('dnqaurlplofnrtmh'), 5)
        self.assertEqual(String.advanced_anagrams('aujteqimwfkjoqodgqaxbrkrwykpmuimqtgulojjwtukjiqrasqejbvfbixnchzsahpnyayutsgecwvcqngzoehrmeeqlgknnb'), 26)
        self.assertEqual(String.advanced_anagrams('lbafwuoawkxydlfcbjjtxpzpchzrvbtievqbpedlqbktorypcjkzzkodrpvosqzxmpad'), 15)
        self.assertEqual(String.advanced_anagrams('drngbjuuhmwqwxrinxccsqxkpwygwcdbtriwaesjsobrntzaqbe'), -1)
        self.assertEqual(String.advanced_anagrams('ubulzt'), 3)
        self.assertEqual(String.advanced_anagrams('vxxzsqjqsnibgydzlyynqcrayvwjurfsqfrivayopgrxewwruvemzy'), 13)
        self.assertEqual(String.advanced_anagrams('xtnipeqhxvafqaggqoanvwkmthtfirwhmjrbphlmeluvoa'), 13)
        self.assertEqual(String.advanced_anagrams('gqdvlchavotcykafyjzbbgmnlajiqlnwctrnvznspiwquxxsiwuldizqkkaawpyyisnftdzklwagv'), -1)
github stunstunstun / python-algorithms / tests / test_string.py View on Github external
def test_advanced_anagrams(self):
        self.assertEqual(String.advanced_anagrams('aaabbb'), 3)
        self.assertEqual(String.advanced_anagrams('ab'), 1)
        self.assertEqual(String.advanced_anagrams('abc'), -1)
        self.assertEqual(String.advanced_anagrams('mnop'), 2)
        self.assertEqual(String.advanced_anagrams('xyyx'), 0)
        self.assertEqual(String.advanced_anagrams('xaxbbbxx'), 1)
        self.assertEqual(String.advanced_anagrams('xaxbbbxa'), 1)
        self.assertEqual(String.advanced_anagrams('abxxabbx'), 1)

        self.assertEqual(String.advanced_anagrams('hhpddlnnsjfoyxpciioigvjqzfbpllssuj'), 10)
        self.assertEqual(String.advanced_anagrams('xulkowreuowzxgnhmiqekxhzistdocbnyozmnqthhpievvlj'), 13)
        self.assertEqual(String.advanced_anagrams('dnqaurlplofnrtmh'), 5)
        self.assertEqual(String.advanced_anagrams('aujteqimwfkjoqodgqaxbrkrwykpmuimqtgulojjwtukjiqrasqejbvfbixnchzsahpnyayutsgecwvcqngzoehrmeeqlgknnb'), 26)
        self.assertEqual(String.advanced_anagrams('lbafwuoawkxydlfcbjjtxpzpchzrvbtievqbpedlqbktorypcjkzzkodrpvosqzxmpad'), 15)
        self.assertEqual(String.advanced_anagrams('drngbjuuhmwqwxrinxccsqxkpwygwcdbtriwaesjsobrntzaqbe'), -1)
        self.assertEqual(String.advanced_anagrams('ubulzt'), 3)
        self.assertEqual(String.advanced_anagrams('vxxzsqjqsnibgydzlyynqcrayvwjurfsqfrivayopgrxewwruvemzy'), 13)
        self.assertEqual(String.advanced_anagrams('xtnipeqhxvafqaggqoanvwkmthtfirwhmjrbphlmeluvoa'), 13)
github stunstunstun / python-algorithms / tests / test_string.py View on Github external
def test_advanced_anagrams(self):
        self.assertEqual(String.advanced_anagrams('aaabbb'), 3)
        self.assertEqual(String.advanced_anagrams('ab'), 1)
        self.assertEqual(String.advanced_anagrams('abc'), -1)
        self.assertEqual(String.advanced_anagrams('mnop'), 2)
        self.assertEqual(String.advanced_anagrams('xyyx'), 0)
        self.assertEqual(String.advanced_anagrams('xaxbbbxx'), 1)
        self.assertEqual(String.advanced_anagrams('xaxbbbxa'), 1)
        self.assertEqual(String.advanced_anagrams('abxxabbx'), 1)

        self.assertEqual(String.advanced_anagrams('hhpddlnnsjfoyxpciioigvjqzfbpllssuj'), 10)
        self.assertEqual(String.advanced_anagrams('xulkowreuowzxgnhmiqekxhzistdocbnyozmnqthhpievvlj'), 13)
        self.assertEqual(String.advanced_anagrams('dnqaurlplofnrtmh'), 5)
        self.assertEqual(String.advanced_anagrams('aujteqimwfkjoqodgqaxbrkrwykpmuimqtgulojjwtukjiqrasqejbvfbixnchzsahpnyayutsgecwvcqngzoehrmeeqlgknnb'), 26)
        self.assertEqual(String.advanced_anagrams('lbafwuoawkxydlfcbjjtxpzpchzrvbtievqbpedlqbktorypcjkzzkodrpvosqzxmpad'), 15)
        self.assertEqual(String.advanced_anagrams('drngbjuuhmwqwxrinxccsqxkpwygwcdbtriwaesjsobrntzaqbe'), -1)
        self.assertEqual(String.advanced_anagrams('ubulzt'), 3)
        self.assertEqual(String.advanced_anagrams('vxxzsqjqsnibgydzlyynqcrayvwjurfsqfrivayopgrxewwruvemzy'), 13)
        self.assertEqual(String.advanced_anagrams('xtnipeqhxvafqaggqoanvwkmthtfirwhmjrbphlmeluvoa'), 13)
        self.assertEqual(String.advanced_anagrams('gqdvlchavotcykafyjzbbgmnlajiqlnwctrnvznspiwquxxsiwuldizqkkaawpyyisnftdzklwagv'), -1)
github stunstunstun / python-algorithms / tests / test_string.py View on Github external
def test_advanced_anagrams(self):
        self.assertEqual(String.advanced_anagrams('aaabbb'), 3)
        self.assertEqual(String.advanced_anagrams('ab'), 1)
        self.assertEqual(String.advanced_anagrams('abc'), -1)
        self.assertEqual(String.advanced_anagrams('mnop'), 2)
        self.assertEqual(String.advanced_anagrams('xyyx'), 0)
        self.assertEqual(String.advanced_anagrams('xaxbbbxx'), 1)
        self.assertEqual(String.advanced_anagrams('xaxbbbxa'), 1)
        self.assertEqual(String.advanced_anagrams('abxxabbx'), 1)

        self.assertEqual(String.advanced_anagrams('hhpddlnnsjfoyxpciioigvjqzfbpllssuj'), 10)
        self.assertEqual(String.advanced_anagrams('xulkowreuowzxgnhmiqekxhzistdocbnyozmnqthhpievvlj'), 13)
        self.assertEqual(String.advanced_anagrams('dnqaurlplofnrtmh'), 5)
        self.assertEqual(String.advanced_anagrams('aujteqimwfkjoqodgqaxbrkrwykpmuimqtgulojjwtukjiqrasqejbvfbixnchzsahpnyayutsgecwvcqngzoehrmeeqlgknnb'), 26)
        self.assertEqual(String.advanced_anagrams('lbafwuoawkxydlfcbjjtxpzpchzrvbtievqbpedlqbktorypcjkzzkodrpvosqzxmpad'), 15)
        self.assertEqual(String.advanced_anagrams('drngbjuuhmwqwxrinxccsqxkpwygwcdbtriwaesjsobrntzaqbe'), -1)
        self.assertEqual(String.advanced_anagrams('ubulzt'), 3)
        self.assertEqual(String.advanced_anagrams('vxxzsqjqsnibgydzlyynqcrayvwjurfsqfrivayopgrxewwruvemzy'), 13)
        self.assertEqual(String.advanced_anagrams('xtnipeqhxvafqaggqoanvwkmthtfirwhmjrbphlmeluvoa'), 13)
        self.assertEqual(String.advanced_anagrams('gqdvlchavotcykafyjzbbgmnlajiqlnwctrnvznspiwquxxsiwuldizqkkaawpyyisnftdzklwagv'), -1)
github stunstunstun / python-algorithms / tests / test_string.py View on Github external
def test_advanced_anagrams(self):
        self.assertEqual(String.advanced_anagrams('aaabbb'), 3)
        self.assertEqual(String.advanced_anagrams('ab'), 1)
        self.assertEqual(String.advanced_anagrams('abc'), -1)
        self.assertEqual(String.advanced_anagrams('mnop'), 2)
        self.assertEqual(String.advanced_anagrams('xyyx'), 0)
        self.assertEqual(String.advanced_anagrams('xaxbbbxx'), 1)
        self.assertEqual(String.advanced_anagrams('xaxbbbxa'), 1)
        self.assertEqual(String.advanced_anagrams('abxxabbx'), 1)

        self.assertEqual(String.advanced_anagrams('hhpddlnnsjfoyxpciioigvjqzfbpllssuj'), 10)
        self.assertEqual(String.advanced_anagrams('xulkowreuowzxgnhmiqekxhzistdocbnyozmnqthhpievvlj'), 13)
        self.assertEqual(String.advanced_anagrams('dnqaurlplofnrtmh'), 5)
        self.assertEqual(String.advanced_anagrams('aujteqimwfkjoqodgqaxbrkrwykpmuimqtgulojjwtukjiqrasqejbvfbixnchzsahpnyayutsgecwvcqngzoehrmeeqlgknnb'), 26)
        self.assertEqual(String.advanced_anagrams('lbafwuoawkxydlfcbjjtxpzpchzrvbtievqbpedlqbktorypcjkzzkodrpvosqzxmpad'), 15)
        self.assertEqual(String.advanced_anagrams('drngbjuuhmwqwxrinxccsqxkpwygwcdbtriwaesjsobrntzaqbe'), -1)
        self.assertEqual(String.advanced_anagrams('ubulzt'), 3)
        self.assertEqual(String.advanced_anagrams('vxxzsqjqsnibgydzlyynqcrayvwjurfsqfrivayopgrxewwruvemzy'), 13)
        self.assertEqual(String.advanced_anagrams('xtnipeqhxvafqaggqoanvwkmthtfirwhmjrbphlmeluvoa'), 13)
        self.assertEqual(String.advanced_anagrams('gqdvlchavotcykafyjzbbgmnlajiqlnwctrnvznspiwquxxsiwuldizqkkaawpyyisnftdzklwagv'), -1)
github stunstunstun / python-algorithms / tests / test_string.py View on Github external
def test_advanced_anagrams(self):
        self.assertEqual(String.advanced_anagrams('aaabbb'), 3)
        self.assertEqual(String.advanced_anagrams('ab'), 1)
        self.assertEqual(String.advanced_anagrams('abc'), -1)
        self.assertEqual(String.advanced_anagrams('mnop'), 2)
        self.assertEqual(String.advanced_anagrams('xyyx'), 0)
        self.assertEqual(String.advanced_anagrams('xaxbbbxx'), 1)
        self.assertEqual(String.advanced_anagrams('xaxbbbxa'), 1)
        self.assertEqual(String.advanced_anagrams('abxxabbx'), 1)

        self.assertEqual(String.advanced_anagrams('hhpddlnnsjfoyxpciioigvjqzfbpllssuj'), 10)
        self.assertEqual(String.advanced_anagrams('xulkowreuowzxgnhmiqekxhzistdocbnyozmnqthhpievvlj'), 13)
        self.assertEqual(String.advanced_anagrams('dnqaurlplofnrtmh'), 5)
        self.assertEqual(String.advanced_anagrams('aujteqimwfkjoqodgqaxbrkrwykpmuimqtgulojjwtukjiqrasqejbvfbixnchzsahpnyayutsgecwvcqngzoehrmeeqlgknnb'), 26)
        self.assertEqual(String.advanced_anagrams('lbafwuoawkxydlfcbjjtxpzpchzrvbtievqbpedlqbktorypcjkzzkodrpvosqzxmpad'), 15)
        self.assertEqual(String.advanced_anagrams('drngbjuuhmwqwxrinxccsqxkpwygwcdbtriwaesjsobrntzaqbe'), -1)
        self.assertEqual(String.advanced_anagrams('ubulzt'), 3)
        self.assertEqual(String.advanced_anagrams('vxxzsqjqsnibgydzlyynqcrayvwjurfsqfrivayopgrxewwruvemzy'), 13)
        self.assertEqual(String.advanced_anagrams('xtnipeqhxvafqaggqoanvwkmthtfirwhmjrbphlmeluvoa'), 13)
        self.assertEqual(String.advanced_anagrams('gqdvlchavotcykafyjzbbgmnlajiqlnwctrnvznspiwquxxsiwuldizqkkaawpyyisnftdzklwagv'), -1)
github stunstunstun / python-algorithms / tests / test_string.py View on Github external
def test_advanced_anagrams(self):
        self.assertEqual(String.advanced_anagrams('aaabbb'), 3)
        self.assertEqual(String.advanced_anagrams('ab'), 1)
        self.assertEqual(String.advanced_anagrams('abc'), -1)
        self.assertEqual(String.advanced_anagrams('mnop'), 2)
        self.assertEqual(String.advanced_anagrams('xyyx'), 0)
        self.assertEqual(String.advanced_anagrams('xaxbbbxx'), 1)
        self.assertEqual(String.advanced_anagrams('xaxbbbxa'), 1)
        self.assertEqual(String.advanced_anagrams('abxxabbx'), 1)

        self.assertEqual(String.advanced_anagrams('hhpddlnnsjfoyxpciioigvjqzfbpllssuj'), 10)
        self.assertEqual(String.advanced_anagrams('xulkowreuowzxgnhmiqekxhzistdocbnyozmnqthhpievvlj'), 13)
        self.assertEqual(String.advanced_anagrams('dnqaurlplofnrtmh'), 5)
        self.assertEqual(String.advanced_anagrams('aujteqimwfkjoqodgqaxbrkrwykpmuimqtgulojjwtukjiqrasqejbvfbixnchzsahpnyayutsgecwvcqngzoehrmeeqlgknnb'), 26)
        self.assertEqual(String.advanced_anagrams('lbafwuoawkxydlfcbjjtxpzpchzrvbtievqbpedlqbktorypcjkzzkodrpvosqzxmpad'), 15)
        self.assertEqual(String.advanced_anagrams('drngbjuuhmwqwxrinxccsqxkpwygwcdbtriwaesjsobrntzaqbe'), -1)
        self.assertEqual(String.advanced_anagrams('ubulzt'), 3)
        self.assertEqual(String.advanced_anagrams('vxxzsqjqsnibgydzlyynqcrayvwjurfsqfrivayopgrxewwruvemzy'), 13)
        self.assertEqual(String.advanced_anagrams('xtnipeqhxvafqaggqoanvwkmthtfirwhmjrbphlmeluvoa'), 13)
        self.assertEqual(String.advanced_anagrams('gqdvlchavotcykafyjzbbgmnlajiqlnwctrnvznspiwquxxsiwuldizqkkaawpyyisnftdzklwagv'), -1)
github stunstunstun / python-algorithms / tests / test_string.py View on Github external
self.assertEqual(String.advanced_anagrams('ab'), 1)
        self.assertEqual(String.advanced_anagrams('abc'), -1)
        self.assertEqual(String.advanced_anagrams('mnop'), 2)
        self.assertEqual(String.advanced_anagrams('xyyx'), 0)
        self.assertEqual(String.advanced_anagrams('xaxbbbxx'), 1)
        self.assertEqual(String.advanced_anagrams('xaxbbbxa'), 1)
        self.assertEqual(String.advanced_anagrams('abxxabbx'), 1)

        self.assertEqual(String.advanced_anagrams('hhpddlnnsjfoyxpciioigvjqzfbpllssuj'), 10)
        self.assertEqual(String.advanced_anagrams('xulkowreuowzxgnhmiqekxhzistdocbnyozmnqthhpievvlj'), 13)
        self.assertEqual(String.advanced_anagrams('dnqaurlplofnrtmh'), 5)
        self.assertEqual(String.advanced_anagrams('aujteqimwfkjoqodgqaxbrkrwykpmuimqtgulojjwtukjiqrasqejbvfbixnchzsahpnyayutsgecwvcqngzoehrmeeqlgknnb'), 26)
        self.assertEqual(String.advanced_anagrams('lbafwuoawkxydlfcbjjtxpzpchzrvbtievqbpedlqbktorypcjkzzkodrpvosqzxmpad'), 15)
        self.assertEqual(String.advanced_anagrams('drngbjuuhmwqwxrinxccsqxkpwygwcdbtriwaesjsobrntzaqbe'), -1)
        self.assertEqual(String.advanced_anagrams('ubulzt'), 3)
        self.assertEqual(String.advanced_anagrams('vxxzsqjqsnibgydzlyynqcrayvwjurfsqfrivayopgrxewwruvemzy'), 13)
        self.assertEqual(String.advanced_anagrams('xtnipeqhxvafqaggqoanvwkmthtfirwhmjrbphlmeluvoa'), 13)
        self.assertEqual(String.advanced_anagrams('gqdvlchavotcykafyjzbbgmnlajiqlnwctrnvznspiwquxxsiwuldizqkkaawpyyisnftdzklwagv'), -1)
github stunstunstun / python-algorithms / tests / test_string.py View on Github external
self.assertEqual(String.advanced_anagrams('aaabbb'), 3)
        self.assertEqual(String.advanced_anagrams('ab'), 1)
        self.assertEqual(String.advanced_anagrams('abc'), -1)
        self.assertEqual(String.advanced_anagrams('mnop'), 2)
        self.assertEqual(String.advanced_anagrams('xyyx'), 0)
        self.assertEqual(String.advanced_anagrams('xaxbbbxx'), 1)
        self.assertEqual(String.advanced_anagrams('xaxbbbxa'), 1)
        self.assertEqual(String.advanced_anagrams('abxxabbx'), 1)

        self.assertEqual(String.advanced_anagrams('hhpddlnnsjfoyxpciioigvjqzfbpllssuj'), 10)
        self.assertEqual(String.advanced_anagrams('xulkowreuowzxgnhmiqekxhzistdocbnyozmnqthhpievvlj'), 13)
        self.assertEqual(String.advanced_anagrams('dnqaurlplofnrtmh'), 5)
        self.assertEqual(String.advanced_anagrams('aujteqimwfkjoqodgqaxbrkrwykpmuimqtgulojjwtukjiqrasqejbvfbixnchzsahpnyayutsgecwvcqngzoehrmeeqlgknnb'), 26)
        self.assertEqual(String.advanced_anagrams('lbafwuoawkxydlfcbjjtxpzpchzrvbtievqbpedlqbktorypcjkzzkodrpvosqzxmpad'), 15)
        self.assertEqual(String.advanced_anagrams('drngbjuuhmwqwxrinxccsqxkpwygwcdbtriwaesjsobrntzaqbe'), -1)
        self.assertEqual(String.advanced_anagrams('ubulzt'), 3)
        self.assertEqual(String.advanced_anagrams('vxxzsqjqsnibgydzlyynqcrayvwjurfsqfrivayopgrxewwruvemzy'), 13)
        self.assertEqual(String.advanced_anagrams('xtnipeqhxvafqaggqoanvwkmthtfirwhmjrbphlmeluvoa'), 13)
        self.assertEqual(String.advanced_anagrams('gqdvlchavotcykafyjzbbgmnlajiqlnwctrnvznspiwquxxsiwuldizqkkaawpyyisnftdzklwagv'), -1)
github stunstunstun / python-algorithms / tests / test_string.py View on Github external
def test_advanced_anagrams(self):
        self.assertEqual(String.advanced_anagrams('aaabbb'), 3)
        self.assertEqual(String.advanced_anagrams('ab'), 1)
        self.assertEqual(String.advanced_anagrams('abc'), -1)
        self.assertEqual(String.advanced_anagrams('mnop'), 2)
        self.assertEqual(String.advanced_anagrams('xyyx'), 0)
        self.assertEqual(String.advanced_anagrams('xaxbbbxx'), 1)
        self.assertEqual(String.advanced_anagrams('xaxbbbxa'), 1)
        self.assertEqual(String.advanced_anagrams('abxxabbx'), 1)

        self.assertEqual(String.advanced_anagrams('hhpddlnnsjfoyxpciioigvjqzfbpllssuj'), 10)
        self.assertEqual(String.advanced_anagrams('xulkowreuowzxgnhmiqekxhzistdocbnyozmnqthhpievvlj'), 13)
        self.assertEqual(String.advanced_anagrams('dnqaurlplofnrtmh'), 5)
        self.assertEqual(String.advanced_anagrams('aujteqimwfkjoqodgqaxbrkrwykpmuimqtgulojjwtukjiqrasqejbvfbixnchzsahpnyayutsgecwvcqngzoehrmeeqlgknnb'), 26)
        self.assertEqual(String.advanced_anagrams('lbafwuoawkxydlfcbjjtxpzpchzrvbtievqbpedlqbktorypcjkzzkodrpvosqzxmpad'), 15)
        self.assertEqual(String.advanced_anagrams('drngbjuuhmwqwxrinxccsqxkpwygwcdbtriwaesjsobrntzaqbe'), -1)
        self.assertEqual(String.advanced_anagrams('ubulzt'), 3)
        self.assertEqual(String.advanced_anagrams('vxxzsqjqsnibgydzlyynqcrayvwjurfsqfrivayopgrxewwruvemzy'), 13)
        self.assertEqual(String.advanced_anagrams('xtnipeqhxvafqaggqoanvwkmthtfirwhmjrbphlmeluvoa'), 13)
        self.assertEqual(String.advanced_anagrams('gqdvlchavotcykafyjzbbgmnlajiqlnwctrnvznspiwquxxsiwuldizqkkaawpyyisnftdzklwagv'), -1)