Programming: Letter Combination Padlock We got a little more Christmas shopping done on the way down to my folks', and while we were in the shop my brother-in-law picked up a combination padlock on a whim: rather than having numbers on its dials it has letters, so you can choose a password rather than have to remember a pin. 4 dials with 10 letters on each. Naturally, we got to wondering how many viable words you can actually make from it's 10,000 possible positions. The program to find that out was trivial. It seemed likely that the letters they chose for each dial were chosen to maximise the number of possible words: but had they chosen the best set they could? To work that out you need to find the actual best collection of letters per dial (well, no, you just need to find a better set). On getting at the padlock when we got home we found that one of the letters on the 4th dial was blank - meaning you had access to 3 letter words. My first attempt quickly gave better results, but I realised I had to temper it: almost the first thing you notice when you look at the padlock is that you can't spell certain swear words (because obviously this is the first thing you try to do). In order for my padlock to count as better than the bought one, it had to be prohibited from allowing the user to spell something that wouldn't get past the company lawyers, so: ****, CUNT and SHIT are tabboo. The store bought padlock has these dials (note the space in the last one = the blank): PBSLGTMHRD UHOAYEINLR CTOASNRELU KE NSYDALT Your challenges (because you have nothing to do on holiday,right?): 1) How many words can the store bought padlock make? 2) Can you find a better layout (i.e. one that can make more words), and if so, by how many more words? Remember: it isn't allowed to spell ****, CUNT or SHIT. Dictionary: https://raw.githubusercontent.com/jesstess/Scrabble/master/scrabble/sowpods.txt