Comment body goes here.
The answer is 3. For ex if you take out the first sock from the shelf and assume its white/black and when you take the second sock it “may” be white/black so you can’t look whether you chose both the same colour or different.So you take out the third sock and then from this if the first sock u picked is black, second is white and third is white you pick white or if first is white second is black and third is black u choose black. So max no of times u remove from the shelf is 3 times! Hope this helps.
In simple words, pigeonhole principle