-7
Description :
Given a string of space separated binary digits or space separated booleans or an array of binary digits or array of booleans . Your job is to find the xor of each until you end up with one answer either 0 or 1. The inputs will always be valid and will only be either 0 or 1.
Example :
1 0 0 1 0 --> 0
1 0 1 1 1 0 0 1 0 0 0 0 --> 1
This is code golf so shortest code will win. Good luck.
1Your job is to find the xor of each until you end up with one answer either 0 or 1 Can you clarify a bit more what that means? – Luis Mendo – 2018-04-13T13:44:18.387
given a string find the xor of first two then the xor of next two and so on. keep at it till you end with one digit. – Muhammad Salman – 2018-04-13T13:45:09.927
14Use the Sandbox! That's 3 challenges in a row that you propose that have troubles. Go to the sandbox, expose your challenge and update it based on community feedback. Then only post it on this site. – Olivier Grégoire – 2018-04-13T13:49:30.457
3Hi, I've downvoted this question because it is very trivial. Most answers are going to be one or two variations, with very little room for creative golfing. – AdmBorkBork – 2018-04-13T14:07:46.953
Can the list of booleans be empty ? – Ton Hospel – 2018-04-13T14:12:06.550
@Adám : done . Ton : that is up to you – Muhammad Salman – 2018-04-13T15:48:25.880