From 7f5af3503f8ee6bedf7887895e1d69161eab7f7a Mon Sep 17 00:00:00 2001
From: Shubham Singh <shubhamsingh@Surinders-MacBook-Air.local>
Date: Tue, 31 Aug 2021 12:29:42 +0530
Subject: [PATCH] Added new riddle

---
 .DS_Store                                     | Bin 0 -> 8196 bytes
 Riddles/.DS_Store                             | Bin 0 -> 6148 bytes
 Riddles/Riddle Interview Problems/.DS_Store   | Bin 0 -> 6148 bytes
 ...oners and hats - SOLUTION-checkpoint.ipynb |   6 ++
 .../Coins and a Scale - SOLUTION.ipynb        |  12 ++--
 .../Prisoners and hats - SOLUTION.ipynb       |  50 ++++++++++++++++
 .../Prisoners and hats-checkpoint.ipynb       |   6 ++
 .../Bridge Crossing.ipynb                     |  12 ++--
 .../Prisoners and hats.ipynb                  |  54 ++++++++++++++++++
 9 files changed, 128 insertions(+), 12 deletions(-)
 create mode 100644 .DS_Store
 create mode 100644 Riddles/.DS_Store
 create mode 100644 Riddles/Riddle Interview Problems/.DS_Store
 create mode 100644 Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/.ipynb_checkpoints/Prisoners and hats - SOLUTION-checkpoint.ipynb
 create mode 100644 Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/Prisoners and hats - SOLUTION.ipynb
 create mode 100644 Riddles/Riddle Interview Problems/Riddle Interview Problems /.ipynb_checkpoints/Prisoners and hats-checkpoint.ipynb
 create mode 100644 Riddles/Riddle Interview Problems/Riddle Interview Problems /Prisoners and hats.ipynb

diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..ceb9393f5cfcdc75a13768152ff4a2934e4cfba6
GIT binary patch
literal 8196
zcmeHM%We}f6us_qQlPB_h$4YB8+K9E2Lif4N<%7CiANz7EC7|6OlU`>Ga)l+R6<bp
zd;u)@1-^qX;9FS1x!0zenY2i35EZ_Wef&Cp9NTg15Rs~OgJq%xB68pu=g+`9#yFqd
zh>e+)IiLccs6!#8v`72oj+C|uRspMk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Z}LY-Nh_ycf#(bOO26z
z4Sk6|hfmPQ(QkfIj8y~$5j$r&^PM>}=S=1!^G8IiKaP4tZ6e}Og^d=9ABbvKdP5eh
zrvYR-M@f<d?a>II6UTsK;9qAzt=%<xhILzE<$k+<bNB)}r6K&!DWM2oN--6*j@pPW
zD5G$Y%F{5FA+o3~WDmOjMGGvVhjWpF28bz<Bd2rZi1nC<s7VTS?lUUB%Xs<c8N;d=
z+28m%9HmK7cDq+>VX<*%=`QCj-n!p<;}2!!mq9r$`a%9m)eeJl7+U*C%JkX}!WT(g
z9k(Amm01}iS)A+OB#P1H^~)rSWYw4BEGl#!-!yRE<jv#u>SVI<WTzuGd)w2FnCxtH
zJL2)?)^ytBE021+gOjt1ca!(i4<9vs#F#-^wm5@NFn)vFb3e~gnY~5yEb}a*!&}FI
z{R{AWw{GTc!j1vQz^@ok`-6Zg^eol}_11wxKLLR18leTYx(KKkVbQZ#8$=6)nNXk!
zW%h}|OgQ|)_VX;(22D6I`}kmXWM*F|OplKILU$+T8FZy%z%ek-z@n+P)%kz$^Y{OJ
zkgGWc90UIq1FW&{@Aok!d$!(~oH}a-^aQFz^{Wl)5ES+})`mKYSD{+aCX@m6EY=3$
Qfw+r+rok1CfxpVYSH4Py;{X5v

literal 0
HcmV?d00001

diff --git a/Riddles/Riddle Interview Problems/.DS_Store b/Riddles/Riddle Interview Problems/.DS_Store
new file mode 100644
index 0000000000000000000000000000000000000000..28af625782f872ba673f39c94ba7a87e233ee28e
GIT binary patch
literal 6148
zcmeHK&2AGh5FWPyoFGIFNK~AB=`En7ML-WoODKm(h*sSK2SDvEyP_*?*Hw1Y6@;LD
z4R{HjgD2o|;2YaTErA0$AVfXU_#4|Zv-0QokBG!@k_?EtL?oe%tqzJ`2=}wj$&zbn
z0fottQ%Z_PR8TeN?HfD;o`HXj0baW|XooUN@H@SJQySAT+Ec2rrngbk6dR92DoKrU
z{W{KdjCkHW9zbt>GXiVDoN-+qxtw3(qdY6Ce*ddjT5esqcuC5R>|E)*3J-K0R#7!6
zhtc>2*S4eTAa?ey*7*-Ril1d^z1O|=P#0B{73tUnXGsc|m(Q~z(e+SIilj7oLfau_
zTekPQE7R%Py^Wq)AKabw)O2I5-&42O@62Xxd3|+of3$!2_TBXT?88ShToTv-ja+qj
z0-s<kMDTGqE^=MGK|JSPU1XBzCZ;Z=EqY8(X%`#w7CoWxr>Xml?5C#=RWIj(0r!`c
zm(Rms{TMw1o`FANfcFOlWeglP7R}ay!aM<he2p*yo38^LqZ|ef8;j_H2pbBtp~5{e
zgbhc#a(;os#-a@;;T|8teOb5{iZEYCer4QA1Qvbi8So68WnkG>yL|pX`u+R=Y>=;c
z20R1*6$7HR8Ey_SBzLyX4UW%R1>J|TuwP@*grIQ8u`&24UV$1xpJD?TIBYDU1>!FP
Nh6Z1F2L37o-vO()iDCc%

literal 0
HcmV?d00001

diff --git a/Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/.ipynb_checkpoints/Prisoners and hats - SOLUTION-checkpoint.ipynb b/Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/.ipynb_checkpoints/Prisoners and hats - SOLUTION-checkpoint.ipynb
new file mode 100644
index 00000000..363fcab7
--- /dev/null
+++ b/Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/.ipynb_checkpoints/Prisoners and hats - SOLUTION-checkpoint.ipynb	
@@ -0,0 +1,6 @@
+{
+ "cells": [],
+ "metadata": {},
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/Coins and a Scale - SOLUTION.ipynb b/Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/Coins and a Scale - SOLUTION.ipynb
index dd6ce0ad..a0fe7e34 100644
--- a/Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/Coins and a Scale - SOLUTION.ipynb	
+++ b/Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/Coins and a Scale - SOLUTION.ipynb	
@@ -17,23 +17,23 @@
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Python 2",
+   "display_name": "Python 3",
    "language": "python",
-   "name": "python2"
+   "name": "python3"
   },
   "language_info": {
    "codemirror_mode": {
     "name": "ipython",
-    "version": 2
+    "version": 3
    },
    "file_extension": ".py",
    "mimetype": "text/x-python",
    "name": "python",
    "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.11"
+   "pygments_lexer": "ipython3",
+   "version": "3.8.8"
   }
  },
  "nbformat": 4,
- "nbformat_minor": 0
+ "nbformat_minor": 1
 }
diff --git a/Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/Prisoners and hats - SOLUTION.ipynb b/Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/Prisoners and hats - SOLUTION.ipynb
new file mode 100644
index 00000000..9b818c89
--- /dev/null
+++ b/Riddles/Riddle Interview Problems/Riddle Interview Problems - SOLUTIONS/Prisoners and hats - SOLUTION.ipynb	
@@ -0,0 +1,50 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "id": "f40082e5",
+   "metadata": {},
+   "source": [
+    "# Prisoners and hats - SOLUTION"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "de7dfbd9",
+   "metadata": {},
+   "source": [
+    "## Problem Statement\n",
+    "There are 100 prisoners all sentenced to death. One night before the execution, the warden gives them a chance to live if they all work on a strategy together. The execution scenario is as follows –\n",
+    "\n",
+    "On the day of execution, all the prisoners will be made to stand in a straight line such that one prisoner stands just behind another and so on. All prisoners will be wearing a hat either of Blue colour or Red. The prisoners don’t know what colour of hat they are wearing. The prisoner who is standing at the last can see all the prisoners in front of him (and what colour of hat they are wearing). A prisoner can see all the hats in front of him. The prisoner who is standing in the front of the line cannot see anything.\n",
+    "\n",
+    "The executioner will ask each prisoner what colour of hat they are wearing one by one, starting from the last in the line. The prisoner can only speak “Red” or “Blue”. He cannot say anything else. If he gets it right, he lives otherwise he is shot instantly. All the prisoners standing in front of him can hear the answers and gunshots.\n",
+    "\n",
+    "Assuming that the prisoners are intelligent and would stick to the plan, what strategy would the prisoners make over the night to minimize the number of deaths?\n",
+    "\n",
+    "## Solution\n"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.8.8"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/Riddles/Riddle Interview Problems/Riddle Interview Problems /.ipynb_checkpoints/Prisoners and hats-checkpoint.ipynb b/Riddles/Riddle Interview Problems/Riddle Interview Problems /.ipynb_checkpoints/Prisoners and hats-checkpoint.ipynb
new file mode 100644
index 00000000..363fcab7
--- /dev/null
+++ b/Riddles/Riddle Interview Problems/Riddle Interview Problems /.ipynb_checkpoints/Prisoners and hats-checkpoint.ipynb	
@@ -0,0 +1,6 @@
+{
+ "cells": [],
+ "metadata": {},
+ "nbformat": 4,
+ "nbformat_minor": 5
+}
diff --git a/Riddles/Riddle Interview Problems/Riddle Interview Problems /Bridge Crossing.ipynb b/Riddles/Riddle Interview Problems/Riddle Interview Problems /Bridge Crossing.ipynb
index 405b8032..db56cd03 100644
--- a/Riddles/Riddle Interview Problems/Riddle Interview Problems /Bridge Crossing.ipynb	
+++ b/Riddles/Riddle Interview Problems/Riddle Interview Problems /Bridge Crossing.ipynb	
@@ -24,23 +24,23 @@
  ],
  "metadata": {
   "kernelspec": {
-   "display_name": "Python 2",
+   "display_name": "Python 3",
    "language": "python",
-   "name": "python2"
+   "name": "python3"
   },
   "language_info": {
    "codemirror_mode": {
     "name": "ipython",
-    "version": 2
+    "version": 3
    },
    "file_extension": ".py",
    "mimetype": "text/x-python",
    "name": "python",
    "nbconvert_exporter": "python",
-   "pygments_lexer": "ipython2",
-   "version": "2.7.11"
+   "pygments_lexer": "ipython3",
+   "version": "3.8.8"
   }
  },
  "nbformat": 4,
- "nbformat_minor": 0
+ "nbformat_minor": 1
 }
diff --git a/Riddles/Riddle Interview Problems/Riddle Interview Problems /Prisoners and hats.ipynb b/Riddles/Riddle Interview Problems/Riddle Interview Problems /Prisoners and hats.ipynb
new file mode 100644
index 00000000..855d6281
--- /dev/null
+++ b/Riddles/Riddle Interview Problems/Riddle Interview Problems /Prisoners and hats.ipynb	
@@ -0,0 +1,54 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "id": "dce1a8f7",
+   "metadata": {},
+   "source": [
+    "# Prisoners and hats"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "aade5a41",
+   "metadata": {},
+   "source": [
+    "## Problem statement\n",
+    "There are 100 prisoners all sentenced to death. One night before the execution, the warden gives them a chance to live if they all work on a strategy together. The execution scenario is as follows –\n",
+    "\n",
+    "On the day of execution, all the prisoners will be made to stand in a straight line such that one prisoner stands just behind another and so on. All prisoners will be wearing a hat either of Blue colour or Red. The prisoners don’t know what colour of hat they are wearing. The prisoner who is standing at the last can see all the prisoners in front of him (and what colour of hat they are wearing). A prisoner can see all the hats in front of him. The prisoner who is standing in the front of the line cannot see anything.\n",
+    "\n",
+    "The executioner will ask each prisoner what colour of hat they are wearing one by one, starting from the last in the line. The prisoner can only speak “Red” or “Blue”. He cannot say anything else. If he gets it right, he lives otherwise he is shot instantly. All the prisoners standing in front of him can hear the answers and gunshots.\n",
+    "\n",
+    "Assuming that the prisoners are intelligent and would stick to the plan, what strategy would the prisoners make over the night to minimize the number of deaths?\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "ed90d944",
+   "metadata": {},
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.8.8"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}