Updated file name
[ou-summer-of-code-2017.git] / monotone-substrings / single_substring_itertools.ipynb
index 80c2d2ac016fa2a4acaa5e97bbf8be379f41ede2..1e0f20d00e3e8969b72f5a9056481f3801797e2a 100644 (file)
@@ -1,5 +1,33 @@
 {
  "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# Monotone substrings\n",
+    "\n",
+    "Given a list of numbers, find the length of longest increasing or decreasing substring in the list.\n",
+    "\n",
+    "For instance, the sequence\n",
+    "  10, 1, 2, 3, 4, 5, 5, 5, 6, 4, 3, 5, 6\n",
+    "contains these increasing or decreasing substrings:\n",
+    "* 10, 1\n",
+    "* 1, 2, 3, 4, 5\n",
+    "* 5, 6\n",
+    "* 6, 4, 3\n",
+    "* 3, 5, 6\n",
+    "\n",
+    "As an extension, allow the substring to contain runs of identical numbers, each of which is included in the length of the longest substring.\n",
+    "\n",
+    "If identical numbers are allowed, the above sequence contains substrings:\n",
+    "* 10, 1\n",
+    "* 1, 2, 3, 4, 5, 5, 5, 6\n",
+    "* 6, 4, 3\n",
+    "* 3, 5, 6\n",
+    "\n",
+    "The list is given as a single line of comma-separated integers. "
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": 1,