What is notable about these 14 sets of words?
accost commit launch deeded adhere heckle silent versed ampere arrive angers theses chance ascent tester stored chaste ascend tinder seeded cohere heckle silent versed debase mucked refile stress demure riffle silent versed endure shelve riling nested forego recess gossip needed herein advice resins stones rebate locket career tested recast costar pirate esters remade astute surest rested
accost commit launch deeded ⟶ accolade communed stitched adhere heckle silent versed ⟶ adhesive hecklers relented ampere arrive angers theses ⟶ amaranth perigees reverses chance ascent tester stored ⟶ chastest ancestor centered chaste ascend tinder seeded ⟶ chastise ascended tendered cohere heckle silent versed ⟶ cohesive hecklers relented debase mucked refile stress ⟶ demurest backfire seedless demure riffle silent versed ⟶ derisive mufflers relented endure shelve riling nested ⟶ enshrine duellist revenged forego recess gossip needed ⟶ foregone recessed gossiped herein advice resins stones ⟶ headrest revision incenses rebate locket career tested ⟶ relocate backrest teetered recast costar pirate esters ⟶ recopies castrate starters remade astute surest rested ⟶ reassure maturest detested
If each six-letter word is divided into three pairs of letters, then combining the corresponding pairs within each row will produce three new eight-letter words.
ACcoST COmmIT LAunCH DEedED ⟶ ACCOLADE communed STITCHED
Note that this also works in the opposite direction: if we divide all eight-letter words into four pairs of letters, and combine the corresponding pairs.
ACcoLAde COmmUNed STitCHed ⟶ ACCOST commit LAUNCH deeded
These recouplings work as long as we can divide the $$m \in \mathbb{N}_0$$ words from each sequence into $$n \in \mathbb{N}_0$$ groups that have the same length, and combine the $$m$$ corresponding groups to form $$n$$ new words. Below you see for example how $$m = 2$$ ten-letter words can be divided into $$n = 5$$ groups of two letters, that we can recouple into $$n = 5$$ new four-letter words.
CAlaMItoUS NEwsCAstER ⟶ CANE laws MICA tost USER INdiVIduAL CHalLEngES ⟶ INCH dial VILE dung ALES LOcoMOtiVE INveSTmeNT ⟶ LOIN cove MOST time VENT MAloDOroUS THreESomES ⟶ MATH lore DOES room USES REcuPEraTE INteSTinES ⟶ REIN cute PEST rain TEES
The words in the given sequence do not need to have the same length, as long as we can divide each word into $$n \in \mathbb{N}_0$$ groups that have the same length.
ABatTOir OUTmasTERing ⟶ ABOUT atmas TOTER iring ABbaCIes HORnedNESses ⟶ ABHOR baned CINES esses ABstRUse AFTereFFEcts ⟶ ABAFT stere RUFFE sects ACtiNIas HOOdedNESses ⟶ ACHOO tided NINES asses ACtiVEly REStreTCHing ⟶ ACRES titre VETCH lying AGlyCOne MASticATIons ⟶ AGMAS lytic COATI neons
Write a function divide that takes two arguments: i) a word (str) and ii) the number of (non-overlapping) groups $$n \in \mathbb{N}_0$$ (int) into which the word must be divided. The function must return a list (list) containing the $$n$$ groups (str) into which the given word can be divided. All groups need to have the same length (same number of letters).
Write a function recouple that takes two arguments: i) a sequence (list or tuple) of $$m \in \mathbb{N}_0$$ words (str) and ii) the number of (non-overlapping) groups $$n \in \mathbb{N}_0$$ (int) into which the words must be divided. The function must return a list (list) containing the $$n$$ new words (str) obtained when each of the $$m$$ given words is divided into $$n$$ groups that have the same length, and if each of the $$m$$ corresponding groups is merged into a new word.
If the word passed to the function divide or at least one of the words passed to the function recouple cannot be divided into $$n$$ groups that have the same length, an AssertionError must be raised with the message invalid division.
>>> divide('accost', 3)
['ac', 'co', 'st']
>>> divide('COMMIT', 3)
['CO', 'MM', 'IT']
>>> divide('accolade', 4)
['ac', 'co', 'la', 'de']
>>> divide('COMMUNED', 4)
['CO', 'MM', 'UN', 'ED']
>>> divide('programming', 5)
Traceback (most recent call last):
AssertionError: invalid division
>>> recouple(['ACcoST', 'COmmIT', 'LAunCH', 'DEedED'], 3)
['ACCOLADE', 'communed', 'STITCHED']
>>> recouple(('ACCOLADE', 'communed', 'STITCHED'), 4)
['ACcoST', 'COmmIT', 'LAunCH', 'DEedED']
>>> recouple('cane laws mica tost user'.split(), 2)
['calamitous', 'newscaster']
>>> recouple('INDIVIDUAL CHALLENGES'.split(), 5)
['INCH', 'DIAL', 'VILE', 'DUNG', 'ALES']
>>> recouple('programming computer games'.split(), 5)
Traceback (most recent call last):
AssertionError: invalid division