"cells": [
{
"cell_type": "code",
- "execution_count": 10,
+ "execution_count": 25,
"metadata": {},
"outputs": [],
"source": [
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": 26,
"metadata": {},
"outputs": [],
"source": [
"def burnt_sorted(pancakes):\n",
- " return pancakes == sorted(pancakes)\n",
+ " return all(p > 0 for p in pancakes) and pancakes == sorted(pancakes)\n",
"\n",
"def unburnt_sorted(pancakes):\n",
" simple_pancakes = [abs(p) for p in pancakes]\n",
},
{
"cell_type": "code",
- "execution_count": 12,
+ "execution_count": 27,
"metadata": {},
"outputs": [],
"source": [
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 28,
"metadata": {},
"outputs": [],
"source": [
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 29,
"metadata": {},
"outputs": [
{
"69"
]
},
- "execution_count": 14,
+ "execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 30,
"metadata": {},
"outputs": [
{
"92"
]
},
- "execution_count": 15,
+ "execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}