Done challenge 4
[cipher-challenge.git] / 2020 / challenge3-clue.ipynb
index ada44458733e900e1bbc15a38639b68bc86524c0..a79b1990ce9e58ecc29a5651e5d264c72ea36d97 100644 (file)
@@ -3,7 +3,9 @@
   {
    "cell_type": "code",
    "execution_count": 1,
-   "metadata": {},
+   "metadata": {
+    "Collapsed": "false"
+   },
    "outputs": [],
    "source": [
     "from szyfrow.support.language_models import *\n",
@@ -14,7 +16,9 @@
   {
    "cell_type": "code",
    "execution_count": 2,
-   "metadata": {},
+   "metadata": {
+    "Collapsed": "false"
+   },
    "outputs": [
     {
      "data": {
   },
   {
    "cell_type": "code",
-   "execution_count": 4,
-   "metadata": {},
+   "execution_count": 3,
+   "metadata": {
+    "Collapsed": "false"
+   },
    "outputs": [],
    "source": [
     "anags8 = collections.defaultdict(list)\n",
   },
   {
    "cell_type": "code",
-   "execution_count": 5,
-   "metadata": {},
+   "execution_count": 4,
+   "metadata": {
+    "Collapsed": "false"
+   },
    "outputs": [
     {
      "data": {
@@ -54,7 +62,7 @@
        "['aegilnrt', 'aeginrst', 'deeinrst', 'ceeprsst', 'aeinrrst']"
       ]
      },
-     "execution_count": 5,
+     "execution_count": 4,
      "metadata": {},
      "output_type": "execute_result"
     }
   },
   {
    "cell_type": "code",
-   "execution_count": 6,
-   "metadata": {},
+   "execution_count": 5,
+   "metadata": {
+    "Collapsed": "false"
+   },
    "outputs": [
     {
      "name": "stdout",
     "    print(c, anags8[c])"
    ]
   },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {
+    "Collapsed": "false"
+   },
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "\"alerting', 'altering', 'integral', 'relating', 'triangle', 'angriest', 'gantries', 'granites', 'ingrates', 'rangiest', 'tangiers', 'dniester', 'inserted', 'nerdiest', 'resident', 'trendies', 'respects', 'scepters', 'sceptres', 'specters', 'spectres', 'restrain', 'retrains', 'strainer', 'terrains', 'trainers\""
+      ]
+     },
+     "execution_count": 13,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "\"', '\".join(w for c in cands for w in anags8[c])"
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": null,
-   "metadata": {},
+   "metadata": {
+    "Collapsed": "false"
+   },
    "outputs": [],
    "source": []
   }