Since they both work,
There are much better ways of making this circuit, you should not connect the analogue input to the switches. You should connect it to the resistor chain and have the switches short out resistors in that chain. Your problem then is when more that one switch is pressed you can not see which ones are being pressed.
Does that mean i have to flip around ground and analogue pin in the first diagram?