text:
Parity of sum of other elements
Task
Given an array of positive integers, replace each element with the parity of the sum of the other elements. The array is guaranteed to have at least 2 elements.
Definition

Parity: whether a number is odd or even.

Example
For the array [1,2,3,1]:

Replace 1 with the parity of 2+3+1, i.e. even.
Replace 2 with the parity of 1+3+1, i.e. odd.
Replace 3 with the parity of 1+2+1, i.e. even.
Replace 1 with the parity of 1+2+3, i.e. even.

Output: [even, odd, even, even]
Input
An array of positive integer.
You may take it as a proper array, or as a linefeed-separated string of positive integers.
You may assume that the array and the values inside are within the handling capability of your language.
Output
An array of two consistent values, one representing odd, one representing even.
You may output it as a linefeed-separated string of the two values.
Testcases
Inputs:
[1, 2, 3, 1]
[1, 2, 3, 2, 1]
[2, 2]
[100, 1001]

Outputs:
[even, odd, even, even]
[even, odd, even, odd, even]
[even, even]
[odd, even]

Note: you may choose other consistent values other than odd and even.
Scoring
This is code-golf. Shortest answer in bytes wins.
Standard loophole applies.

Just a question - can you always recover the parity of the other elements?

Jelly, 3 bytes
+SḂ

Try it online!
How it works
+SḂ  Main link. Argument: A (array)

 S   Compute the sum of A.
+    Add the sum to each element of A.
     Using _ (subtraction) or ^ (bitwise XOR) would also work.
  Ḃ  Bit; compute the parity of each resulting integer.

That's a clever approach.

@LeakyNun It's the same approach everyone else is using, only shorter :P

@ETHproductions Pretty much, yes. Thete are only so many ways to compute the parity...

@ETHproductions this uses addition instead of subtraction...

@LeakyNun True, my Japt answer does as well. In Jelly it'd just be _SḂ

JavaScript (ES6), 38 36 32 bytes
a=>a.map(b=>eval(a.join`+`)-b&1)

Uses 0 for even and 1 for odd.
Test

f=
a=>a.map(b=>eval(a.join`+`)-b&1)
console.log(f([1, 2, 3, 1]))
console.log(f([1, 2, 3, 2, 1]))
console.log(f([100, 1001]))

2 bytes off: c-b&1 instead of (c-b)%2

Bah! You beat me to it!

I'll have to remember to use eval(a.join\+`)overa.reduce((x,y)=>x+y)`. That's clever

Haskell, 20 bytes
f x=odd.(sum x-)<$>x

Uses True for odd values and Falsefor even values.
Try it online!
Subtract each element from the sum of the list and test if it's odd.
f turned to pointfree has also 20 bytes: map=<<(odd.).(-).sum.

05AB1E (legacy), 4 3 bytes
O^È

Try it online!
O   # Sum
 ^  # XOR with (implicit) input
  È # Print 1 for even / 0 for odd

1 byte off

I know it's been a while, but you can remove the initial D, since input is implicitly.

MATL, 5, 4 bytes
ts-o

Try it online!
One byte saved thanks to Dennis!
This gives '1' for odd and '0' for even. Explanation:
t       % Duplicate the input
 s      % Get the sum of the input
  -     % Subtract it from the original input
   o    % Get the parity of each element

Alice, 31 28 bytes
/O.HQ\d$K@
\i#\ /d2-&+!w?+2%

Try it online!
The input format doesn't matter as long as the integers are separated. The output format is linefeed-separated.
The layout is probably still not optimal but I haven't found a way to shorten this further yet.
Explanation
/     Reflect to SE. Switch to Ordinal.
i     Read all input as a string.
      Reflect off bottom boundary. Move to NE.
.     Duplicate the input string.
      Reflect off top boundary. Move to SE.
\     Reflect to N. Switch to Cardinal.
H     Implicitly convert the top copy of the input to the integers it
      contains and take the absolute value of the top-most one. (Taking
      the absolute value doesn't do anything, but we need the implicit
      conversion to integers.)
      The IP wraps back to the second line.
\     Reflect to SE. Switch to Ordinal.
      Immediately reflect off bottom boundary. Move to NE.
Q     Reverse the stack (this converts the integers back to strings but
      that's irrelevant). After this, we end up with all the individual
      integers on the bottom of the stack in reverse order and the other
      copy of the input string with all integers on top.
      Reflect off top boundary. Move to SE.
/     Reflect to E. Switch to Cardinal.
d     Push the stack depth, which is one more than the number of list
      elements (due to the other input string on the stack).
2-    Subtract 2.
&+    Run + that many times, which implicitly converts the second string
      to the integers it contains and then adds up all the list elements.
!     Store the sum on the tape.
w     Push the current IP position to the return address stack. This
      lets us return here repeatedly to implement a loop.

  ?+    Retrieve the input sum from the tape and add it to the current
        element.
  2%    Compute its parity. Other ways to do this are 1A and 0x. 2F would
        also work but it gives 0/2 instead of 0/1.
        The IP wraps the first column of the grid.
  \     Reflect to NE. Switch to Ordinal. The IP bounces diaginally up
        and down until it hits the next \.
  O     Implicitly convert the current parity to a string and print it
        with a trailing linefeed.
  #     Skip the next command (the H).
  \     Reflect to E. Switch to Cardinal.
  d     Push the stack depth. This is zero when we're done.
  $     Skip the next command if the stack depth is indeed zero, which
        exits the loop.

K     Jump to the return address on top of the return address stack without
      popping it (so that the next K will jump there again).

@     Terminate the program.

Pyth, 7 6 bytes
mi2-sQ

-1 Byte thanks to @KZhang
Outputs 1 for odd, 2 for even.
Try it!
Explanation
m%-sQd2
m      Q    # For each element in the (implicit) input list
   sQ       # Take the sum of all the elements
  -  d      # subtract that element, so that we now have the sum of the other elements
 %    2     # modulo 2; 1=off, 0=even

By changing the modulo %_2 to a GCD i2_, you can even make the d implicit changing the code to mi2-sQ, saving a byte. The outputs are changed to 2 for even, and 1 for odd.

Python 2, 33 31 bytes
-2 bytes thanks to Leaky Nun

lambda x:[sum(x)-z&1for z in x]

Try it online!

2 bytes off: sum(x)-z&1 instead of (sum(x)-z)%2

sum(x,z)%2 would also work

R, 21 bytes
(sum(n<-scan())-n)%%2

reads the list from stdin and returns 0 for even, 1 for odd. binds the input to the variable n inside the call to sum instead of calling it outside, i.e., n=scan();(sum(n)-n)%%2
Try it online!

J, 6 bytes
2|]++/

Try it online!

Mathematica, 13 bytes
#+Tr@#&/*OddQ

or
OddQ[#+Tr@#]&

Clojure, 30 bytes
#(for[i %](odd?(apply - i %)))

Substracts all values from each value in turn, for example with input [a b c d] the 2nd calculated value is b - a - b - c - d = -(a + c + d). Output is false for even and true for odd.
But you might as well use + and calculate each subsequent term twice so it doesn't affect the parity.

CJam, 10 bytes
{_:+f+1f&}

This is an anonymous block (function) that takes the input from the stack and replaces it by the output.
Try it online!
Explanation
Consider input [1 2 3 1].
{         e# Begin block
          e#   STACK: [1 2 3 1]
  _       e#   Duplicate
          e#   STACK: [1 2 3 1], [1 2 3 1]
  :+      e#   Fold addition over the array: compute its sum
          e#   STACK: [1 2 3 1], 7
  f+      e#   Map addition over the array with extra parameter
          e#   STACK: [8 10 11 8]
  1       e#   Push 1
          e#   STACK: [8 10 11 8], 1
  f&      e#   Map bit-wise "and" over the array with extra parameter
          e#   STACK: [0 0 1 0]
}         e# End block

APL (Dyalog Unicode), 19 7 bytes
Golfed 12 bytes thanks to @Adám
2|+/-¨⊢

Try it online!

Japt, 7 bytes
£x +X&1

Try it online!
Explanation
 £   x +X&1
 mX{ x +X&1}  // Ungolfed
UmX{Ux +X&1}  // Variable introduction

UmX{       }  // Replace each item in the input array with
         &1   //   the parity of
    Ux        //   the sum of the input array
       +X     //   plus X.
              // Implicit: output result of last expression

PHP, 50 Bytes
Online Versions
1 for odd , 0 for even
Output as string separated with _
<?foreach($_GET as$v)echo array_sum($_GET)-$v&1,_;

PHP, 72 Bytes
Output as array use array_map

<?print_r(array_map(function($v){return array_sum($_GET)-$v&1;},$_GET));

You can drop the ?:0 it doesn't do anything. foreach($_GET as$v)echo array_sum($_GET)-$v&1,_;

Perl 5, 31 bytes
sub{map$x+=$_,@_;map$x-$_&1,@_}

Outputs 1 for odd and 0 for even.

+1, nice. I think this is 28 bytes, though: perldoc perlsub says, "The signature is part of a subroutine's body. Normally the body of a subroutine is simply a braced block of code.".

@msh210 Thanks! I don't think that's how it works, though- sure the body of the subroutine is only 28 bytes, but you can't leave out sub without breaking it.

But sometimes a subroutine works without sub, e.g. after sort or grep or as an argument to another subroutine. This may be worth asking about on [meta].

@msh210 A subroutine works without sub only if it is used in a prototyped function (sort and grep are more or less prototyped). But otherwise, the sub is required. Regardless, golfing 3 bytes by omitting sub isn't really interesting.

Retina, 40 38 bytes
\d+
¶$` $'
^¶

\d+
$*
+` |11

%M`1
¶

Try it online! Outputs 1 for odd and 0 for even. Explanation: The first two lines duplicate the input once for each number in the input, but without the element itself. This creates an extra blank line which is then deleted. The input is then converted from decimal to unary, the spaces are deleted and the parity computed. Even parity is then converted to zero and the results joined back in to one line. Edit: Saved 2 bytes thanks to @FryAmTheEggman. I tried some other versions which are conceptually more pleasing but which take far too many bytes to express:
\d\B

T`2468O`00001
T`d`10`^([^1]*1[^1]*1)*[^1]*1[^1]*$

Changes all inputs to their parity, then flips all their parities if the total has odd parity.
\d+
$*
^.*
$&¶$&
 (?=.*$)

11

\B
0
T`d`10`.*¶1
¶0

Sums a duplicate of the input, then takes the parity of everything, then inverts the parities if the sum is odd, then deletes the sum again.

I tried what came to mind for me, and got a slightly shorter solution, though I still think it's hardly optimal. Particularly I don't like how I handle the extra zero I get at the end.

@FryAmTheEggman Your saving comes from having a less visible way of converting your ;s back to spaces. If you put the ; at the beginning then you can save a byte by deleting it immediately instead of after it converts to a 0.

Actually, looking again, why isn't your last stage just replacing newlines with spaces? Wouldn't that save 2 bytes?

@FryAmTheEggman Yes; I think I originally had more than one replacement to make in a previous iteration.

C, 68 62 bytes
i;s;f(c,l)int*l;{while(i<c)s+=l[i++];while(i)l[--i]=s-l[i]&1;}

1 for odd, 0 for even
Detailed Try Online
f(int c, int * l)
{
    int i = 0, s = 0;

    while(i < c)
    {
        s = s + l[i];
        i = i + 1;
    }

    // assert(i == c)

    while(i > 0)
    {
        i = i - 1;
        l[i] = s - l[i]&1;
    }
}

Ohm, 4 bytes
DΣ-é

Try it online!
Basically a direct port of the MATL and 05AB1E answers. Uses true for even and false for odd.

Clojure(Script), 36 bytes
Output is true for odd and false for even. Both output and input are sequences.
(fn[l](map #(odd?(-(apply + l)%))l))

Julia 1.0, 17 bytes
x->(sum(x).-x).%2

Try it online!

k, 9 bytes
{2!x-+/x}

The output is a 1 for odd, and a 0 for even. Try it online.
Converted to pseudocode, it would be:
for number in x:
    yield (number - sum(x)) % 2

Scala, 19 bytes
x=>x.map(x.sum-_&1)

Try it online!

Java, 81 78 bytes
3 bytes thanks to Kevin Cruissen
void f(int[]a){int s=0,i=a.length;for(int x:a)s+=x;for(;i-->0;a[i]=s-a[i]&1);}

Try it online!
Modifies the array in-place.

You can golf it by 3 bytes like this: void f(int[]a){int s=0,i=a.length;for(int x:a)s+=x;for(;i-->0;a[i]=s-a[i]&1);}

67 bytes if you use a lambda: Try it online!

Thanks, but I don't like to use a lambda.

Brain-Flak, 94 68 66 bytes
({({}<>)<>})<>{<>(({})<({}<>{}<>(())){({}[()]<([{}])>)}{}>)<>}<>{}

Try it online!
This seems a little long for the task.  There might be a more convenient way to do this.
Explanation
First we calculate the sum of the stack with:
({({}<>)<>})

The we go through the entire stack adding that result to each element and determine the pairity
<>{<>(({})<({}<>{}<>(())){({}[()]<([{}])>)}{}>)<>}<>{}

This uses a pretty cool mod 2 algorithm I came up with for this challenge.
({}(())){({}[()]<([{}]())>)}{}

This pushes 1 under the input decrements until the input reaches zero each time performing 1-n to the 1 we placed earlier, it then removes the input.

You can mod 2 at the last. You don't need to mod 2 the sum.

@LeakyNun Thanks! I just realized that and made the fix.

AWK, 64 bytes
{for(i=0;++i<=NF;print s[i]%2)for(j=0;++j<=NF;)if(i!=j)s[i]+=$j}

Try it online!
Outputs a 0 for even sums and 1 for odd sums separated by newlines.  The only even slightly out-of-the-box thinking was placing the print command inside the for "increment" step.  I tried a few "clever" ways to print, but they didn't save bytes.
Just for giggles, if you don't want newlines:
{for(i=0;++i<=NF;m=m,s[i]%2)for(j=0;++j<=NF;)if(i!=j)s[i]+=$j}1

which has the same byte-count as above, but is a bit more obtuse.

Wise, 54 52 bytes
::^:??[:!^:?^:!^:?^?]|!::^??[!:?^:><^!:?^:!^:?^?]!&|

Try it online!
Explanation
This code would be a lot shorter if it didn't take so many bytes to swap the top two elements.  The current record is
:?^:!^:?^!

This unfortunately constitutes the majority of the code.

First we take the XOR sum of the stack
::^:??[:!^:?^:!^:?^?]|!

We then XOR this with every element and the element with it last bit zeroed
::^??[!:?^:><^!:?^:!^:?^?]!&|

Swift - 55 bytes

Finally beats C! Also, 0 for even, 1 for odd
func g(a:[Int]){for i in a{print((a.reduce(0,+)-i)%2)}}

A function, with usage: g(a: [1,2,3,2,1]   // => 0 1 0 1 0
Check it out!

Not familiar with Swift, but in many languages you can replace (x-y)%2 with x-y&1

@Cyoce For me, after testing, it doesn't work. Bitwise operations aren't Swift's forte

Axiom, 45 bytes
f(a)==[(reduce(+,a)-a.j)rem 2 for j in 1..#a]

no check for input type, possible recalculation  of sum "a" each element...tests
(27) -> [[a,f(a)] for a in [[1,2,3,1], [1,2,3,2,1], [2,2], [100, 1001] ]]
   (27)
   [[[1,2,3,1],[0,1,0,0]], [[1,2,3,2,1],[0,1,0,1,0]], [[2,2],[0,0]],
    [[100,1001],[1,0]]]

Japt, 6 bytes
®nUx)v

Try it
®nUx)v     :Implicit input of array U
®          :Map
 n         :Subtract from
  Ux       :  Sum of U
    )      :End subtraction
     v     :Divisible by 2?

Python 2, 32 bytes
map(lambda x:sum(s)-x&1,input())

Try it online!

TI-Basic, 9 bytes
fPart(.5(sum(Ans)+Ans

Takes input in Ans. Output is stored in Ans and displayed. Outputs .5 for odd numbers and 0 for even ones.

Fig, \$4\log_{256}(96)\approx\$ 3.292 bytes
%2-S

1 for odd, 0 for even.
Try it online!
%2-S
   S  # sum
  -   # minus each item of input array
%2    # mod each by 2

%2 can be replaced with O

@Seggan -S yields a list, O  would join that list by nothing, unless it has been updated.

oops, true. never mind

Perl 6, 16 bytes
{(.sum X-$_)X%2}

Try it
This results in a list where 0 represents even and 1 represents odd.
Expanded:
{  # bare block lambda with implicit parameter $_
  (
    .sum  # the sum of the input array
    X[-]  # crossed using &infix:« - »
    $_    # the input

    # this produces the sum of the other elements

  )
  X[%]    # cross that using &infix:« % » the modulus operator
  2       # with 2
}

Ruby, 47 33 31 Bytes
->a{a.map{|x|a.inject(:+)-x&1}}

It maps through each element, determining the parity of the sum of all elements minus the current element (thus making it 0).

C#, 142 121 bytes

Data

Input An array of 32-byte signed integers
Output An array of 32-byte signed integers where 0 represents even and 1 represents odd

Golfed
(int[] i)=>{var l=i.Length;var o=new int[l];var s=0;foreach(int x in i)s+=x;for(int x=0;x<l;x++)o[x]=s-i[x]&1;return o;};

Ungolfed
( int[] i ) => {
   var l = i.Length;
   var o = new int[ l ];
   var s = 0;

   foreach( int x in i )
      s += x;

   for( int x = 0; x < l; x++ )
      o[ x ] = s - i[ x ] & 1;

   return o;
};

Ungolfed readable
// Takes an array of Int32 objects ( 32-byte signed integers )
( int[] i ) => {
   // Save the length of the array to save on byte count
   var l = i.Length;

   // Initialize an array with the same size the the input array
   var o = new int[ l ];

   // Initialize a var to store the sum of all numbers
   var s = 0;

   // Cycle through every number from the input
   foreach( int x in i )

      // Sum all of them
      s += x;

   // Cycle again through every number
   for( int x = 0; x < l; x++ )

      // Subtracts the number for the sum
      //    and performs a bitwise and
      o[ x ] = s - i[ x ] & 1;

   // Return the array with odds and evens
   return o;
};

Full code
using System;
using System.Collections.Generic;

namespace Namespace {
   class Program {
      static void Main( String[] args ) {
         Func<Int32[], Int32[]> f = ( int[] i ) => {
            var l = i.Length;
            var o = new int[ l ];
            var s = 0;

            foreach( int x in i )
               s += x;

            for( int x = 0; x < l; x++ )
               o[ x ] = s - i[ x ] & 1;

            return o;
         };

         List<Int32[]>
            testCases = new List<Int32[]>() {
               new Int32[] { 1, 2, 3, 1 },
               new Int32[] { 1, 2, 3, 2, 1 },
               new Int32[] { 2, 2 },
               new Int32[] { 100, 1001 },
            };

         foreach( Int32[] testCase in testCases ) {
            Console.WriteLine( $" Input: {String.Join( ",", testCase )}\nOutput: {string.Join( ",", f( testCase ) )}\n" );
         }

         Console.ReadLine();
      }
   }
}

Releases

v1.1 - -21 bytes - Changed the output to an array of ints to reduce the byte count thanks to Arthur Rey's comment. Changed the ternary verification to a bitwise operation, thanks to Cyoce's suggestion
v1.0 - 142 bytes - Initial solution.

Notes

None

You can just have o[x]=(s-i[x])%2==0 instead of o[x]=(s-i[x])%2==0?"even":"odd" since you're allowed to return consistent values else than even and odd.

If I'm not mistaken instead of (s-i[x])%2 you can have s-i[x]&1

Factor + math.unicode, 32 27 bytes
[ dup Σ v-n [ odd? ] map ]

Try it online!
Outputs t for odd and f for even.
               ! { 1 2 3 1 }
dup            ! { 1 2 3 1 } { 1 2 3 1 }
Σ              ! { 1 2 3 1 } 7
v-n            ! { -6 -5 -4 -6 }
[ odd? ] map   ! { f t f f }

Arturo, 24 bytes
$[a][map a=>[%&-∑a 2]]

Try it

Thunno 2, 3 bytes
S+ɗ

Try it online!
Explanation
S+ɗ  # Implicit input
S    # Sum the input
 +   # Add to input
  ɗ  # Parity of each
     # Implicit output

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Output all SE sites URLs
Your challenge is to output this:
https://stackoverflow.com/
https://serverfault.com/
https://superuser.com/
https://meta.stackexchange.com/
https://webapps.stackexchange.com/
https://gaming.stackexchange.com/
https://webmasters.stackexchange.com/
https://cooking.stackexchange.com/
https://gamedev.stackexchange.com/
https://photo.stackexchange.com/
https://stats.stackexchange.com/
https://math.stackexchange.com/
https://diy.stackexchange.com/
https://gis.stackexchange.com/
https://tex.stackexchange.com/
https://askubuntu.com/
https://money.stackexchange.com/
https://english.stackexchange.com/
https://stackapps.com/
https://ux.stackexchange.com/
https://unix.stackexchange.com/
https://wordpress.stackexchange.com/
https://cstheory.stackexchange.com/
https://apple.stackexchange.com/
https://rpg.stackexchange.com/
https://bicycles.stackexchange.com/
https://softwareengineering.stackexchange.com/
https://electronics.stackexchange.com/
https://android.stackexchange.com/
https://boardgames.stackexchange.com/
https://physics.stackexchange.com/
https://homebrew.stackexchange.com/
https://security.stackexchange.com/
https://writers.stackexchange.com/
https://video.stackexchange.com/
https://graphicdesign.stackexchange.com/
https://dba.stackexchange.com/
https://scifi.stackexchange.com/
https://codereview.stackexchange.com/
https://codegolf.stackexchange.com/
https://quant.stackexchange.com/
https://pm.stackexchange.com/
https://skeptics.stackexchange.com/
https://fitness.stackexchange.com/
https://drupal.stackexchange.com/
https://mechanics.stackexchange.com/
https://parenting.stackexchange.com/
https://sharepoint.stackexchange.com/
https://music.stackexchange.com/
https://sqa.stackexchange.com/
https://judaism.stackexchange.com/
https://german.stackexchange.com/
https://japanese.stackexchange.com/
https://philosophy.stackexchange.com/
https://gardening.stackexchange.com/
https://travel.stackexchange.com/
https://productivity.stackexchange.com/
https://crypto.stackexchange.com/
https://dsp.stackexchange.com/
https://french.stackexchange.com/
https://christianity.stackexchange.com/
https://bitcoin.stackexchange.com/
https://linguistics.stackexchange.com/
https://hermeneutics.stackexchange.com/
https://history.stackexchange.com/
https://bricks.stackexchange.com/
https://spanish.stackexchange.com/
https://scicomp.stackexchange.com/
https://movies.stackexchange.com/
https://chinese.stackexchange.com/
https://biology.stackexchange.com/
https://poker.stackexchange.com/
https://mathematica.stackexchange.com/
https://cogsci.stackexchange.com/
https://outdoors.stackexchange.com/
https://martialarts.stackexchange.com/
https://sports.stackexchange.com/
https://academia.stackexchange.com/
https://cs.stackexchange.com/
https://workplace.stackexchange.com/
https://windowsphone.stackexchange.com/
https://chemistry.stackexchange.com/
https://chess.stackexchange.com/
https://raspberrypi.stackexchange.com/
https://russian.stackexchange.com/
https://islam.stackexchange.com/
https://salesforce.stackexchange.com/
https://patents.stackexchange.com/
https://genealogy.stackexchange.com/
https://robotics.stackexchange.com/
https://expressionengine.stackexchange.com/
https://politics.stackexchange.com/
https://anime.stackexchange.com/
https://magento.stackexchange.com/
https://ell.stackexchange.com/
https://sustainability.stackexchange.com/
https://tridion.stackexchange.com/
https://reverseengineering.stackexchange.com/
https://networkengineering.stackexchange.com/
https://opendata.stackexchange.com/
https://freelancing.stackexchange.com/
https://blender.stackexchange.com/
https://mathoverflow.net/
https://space.stackexchange.com/
https://sound.stackexchange.com/
https://astronomy.stackexchange.com/
https://tor.stackexchange.com/
https://pets.stackexchange.com/
https://ham.stackexchange.com/
https://italian.stackexchange.com/
https://pt.stackoverflow.com/
https://aviation.stackexchange.com/
https://ebooks.stackexchange.com/
https://alcohol.stackexchange.com/
https://softwarerecs.stackexchange.com/
https://arduino.stackexchange.com/
https://expatriates.stackexchange.com/
https://matheducators.stackexchange.com/
https://earthscience.stackexchange.com/
https://joomla.stackexchange.com/
https://datascience.stackexchange.com/
https://puzzling.stackexchange.com/
https://craftcms.stackexchange.com/
https://buddhism.stackexchange.com/
https://hinduism.stackexchange.com/
https://communitybuilding.stackexchange.com/
https://startups.stackexchange.com/
https://worldbuilding.stackexchange.com/
https://ja.stackoverflow.com/
https://emacs.stackexchange.com/
https://hsm.stackexchange.com/
https://economics.stackexchange.com/
https://lifehacks.stackexchange.com/
https://engineering.stackexchange.com/
https://coffee.stackexchange.com/
https://vi.stackexchange.com/
https://musicfans.stackexchange.com/
https://woodworking.stackexchange.com/
https://civicrm.stackexchange.com/
https://health.stackexchange.com/
https://ru.stackoverflow.com/
https://rus.stackexchange.com/
https://mythology.stackexchange.com/
https://law.stackexchange.com/
https://opensource.stackexchange.com/
https://elementaryos.stackexchange.com/
https://portuguese.stackexchange.com/
https://computergraphics.stackexchange.com/
https://hardwarerecs.stackexchange.com/
https://es.stackoverflow.com/
https://3dprinting.stackexchange.com/
https://ethereum.stackexchange.com/
https://latin.stackexchange.com/
https://languagelearning.stackexchange.com/
https://retrocomputing.stackexchange.com/
https://crafts.stackexchange.com/
https://korean.stackexchange.com/
https://monero.stackexchange.com/
https://ai.stackexchange.com/
https://esperanto.stackexchange.com/
https://sitecore.stackexchange.com/
https://iot.stackexchange.com/
https://literature.stackexchange.com/
https://vegetarianism.stackexchange.com/
https://ukrainian.stackexchange.com/
https://devops.stackexchange.com/

(trailing whitespace permitted)
Note: these are the only URLs not on StackExchange.com:
https://stackoverflow.com/
https://serverfault.com/
https://superuser.com/
https://askubuntu.com/
https://stackapps.com/
https://mathoverflow.net/
https://pt.stackoverflow.com/
https://ja.stackoverflow.com/
https://ru.stackoverflow.com/
https://es.stackoverflow.com/

All site URLs match this regex:
^http?://([^/]+\.)*(stackoverflow\.(com(\.br)?|ru)|mathoverflow\.(com|net)|hashcode\.ru|((the)?arqade|chiphacker|(mi)?yodeya|ask(ubuntu|different|patents)|(seasoned|brew)advice|s(erverfault|(tack|keptic)exchange|uperuser|tackapps|harepointoverflow|ocialsounddesign)|nothingtoinstall|crossvalidated|basicallymoney)\.com)(/.*)?$

(based on this)
You may use any delimiter, not just newlines. Also, order is not important.
Area 51 is not included.
This is not a dupe of The Stack Exchange Site List or Recognise Stack Exchange Sites by Their Icon, because the names involved in the first one are (different "dba" !== "Database Administrators"), and you have to deal with separate domains.

How important is order in the output?

@ValueInk you can output in any order.

Related.

@programmer5000 what I said on your other challenge also applies to this one, also for the dupe and the dupe's dupe -> plain compression is the best algorithm, because the text don't have enough room for any other kind of optimization

The new domains and abbreviations still don't separate it enough. The other challenge answers use a simple dictionary lookup, it's trivial to modify that to add different domains.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Stop walking into walls!
Some text-based rogue-likes don't let you walk into walls, and give you your move back if you try to. Why do that when you can make the player move in the closest valid direction?
The challenge
Write a program of function that, given a direction and a 3 by 3 grid of characters, outputs the same grid after the player has taken a step.
For example,
9
#..
.@#
#.#

becomes
#.@
..#
#.#

Input

The direction is given by a single digit from 1 to 9, each corresponding to 8 cardinal directions and standing still. This is derived from the relative locations of the numbers on a keypad:

NW   N   NE
..\  |  /
...7 8 9
W- 4 5 6 -E
...1 2 3
../  |  \
SW   S   SE
However, you may also use the numbers 123, 456, 789 instead of 789, 456, 123. In other words, you may swap the top and bottom 2 rows or numbers if you so choose. These are the only 2 acceptable index combinations.
The 3 by 3 grid will consist of 3 distinct, printable ASCII characters representing walkable floor, walls, and the player. (In the test cases, . is used for floor, #s are walls, and @ is the player)
You may choose what characters your program uses, but you must state them in your answer and they must be consistent over multiple trials.
The character representing the character will always be in the middle of the 3 by  3 grid, and the direction will always be between 1 and 9 (incl.)
You may take input in any order
The 3 by 3 grid can be input as a char array, a string array, a 9 length string, or another reasonable alternative.

Output

Return from a function, or output to StdOut or closest alternative
Trailing spaces and newlines are allowed
You must use the same character representations as the input
The same formats allowed for inputs are allowed for outputs

How the player moves
If the specified direction is blocked by a wall (e.g. if the above example had direction 6), then look at the 2 closest directions:

If one (and only one) direction is free, move the player in that direction.
If no directions are free, look at the next closest 2 directions (excluding direction 5). If you have wrapped all the way around and found no open direction (player surrounded by walls), do not move the player
If both of the directions are open, pick one to move to at random (although not necessarily uniformly).

If the given direction is a 5, do not move the player
Test cases
(# = wall, . = floor, @ = player)

Input:

9
#..
.@#
#.#

Output:

#.@
..#
#.#

Input:

3
#..
.@#
#.#

Output:

#..
..#
#@#

Input:

7
##.
#@#
..#

Output:

##@      ##.
#.#  or  #.#
..#      @.#

Input:

5
...
.@.
...

Output:

...
.@.
...

Input:

2
###
#@#
###

Output:

###
#@#
###

Scoring
This is code-golf, so the shortest answer in bytes wins.

Not using yuhjklbn? RIP.

Also, I don't really like the "pick an alternative direction" part as much.  It's kinda different from the other part of the challenge, which is "move the player in a specified direction and output.". That's just personal preference though.

3 line string falls under "reasonable alternative", and is acceptable. Also fixed the returning from a function bit.

This part is confusing: "If no directions are free, look at the next closest 2 directions."

Can we assign a number instead of an ASCII character for each element, then take input as a 2-dimensional list? Or do they have to be strings?

Can I use the directions 123;456;789 instead of 789;456;123?

@LeakyNun Sure.

If the random generation does not have to be uniform, can I just always pick the one counterclockwise to it?

@HyperNeutrino No, there must be a >0 chance of each option

Okay. Thanks for clarifying.

This sounds like a thing speedrunners could use.

Pyth - 73 70 bytes
Kmsd"78963214"DPGJXXYt@K+xKQG\@4\.R?q/J\#/Y\#Jk=YwV5=GflTmPd(N_N)IGOGB

Try It
Input consists of two lines:
1st line: direction of move
2nd line:  The board (positions 123456789, with 123 being the top row)

JavaScript (ES6), 192 163 bytes
a=>b=>a[(a[4]=0)+--b]?(A=(c,d)=>c==b|(e=a[c])-(f=a[d])|!e?(a[c-b?(e?e<f:new Date&1)?c:d:4]=2,a):A(+g[c],+h[d]))(+(g="3016X2785")[b],+(h="1250X8367")[b]):(a[b]=2,a)

Notes
This function uses a special input format. The first input is an array of integers (0 for floor, 1 for wall and 2 for player) representing the map. The second input is the (flipped) direction: 1 is north-west, 2 is north, 3 is north-east, 4 is west etc. The inputs should be given through currying syntax (Z(a)(b)).
Test cases
The maps and directions have been modified to suit my input format.

Z=
a=>b=>a[(a[4]=0)+--b]?(A=(c,d)=>c==b|(e=a[c])-(f=a[d])|!e?(a[c-b?(e?e<f:new Date&1)?c:d:4]=2,a):A(+g[c],+h[d]))(+(g="3016X2785")[b],+(h="1250X8367")[b]):(a[b]=2,a)

testcases = [
    [[1,0,0,0,2,1,1,0,1], 3],
    [[1,0,0,0,2,1,1,0,1], 9],
    [[1,1,0,1,2,1,0,0,1], 1],
    [[0,0,0,0,2,0,0,0,0], 5],
    [[1,1,1,1,2,1,1,1,1], 2]
]
for (test of testcases) {
    console.log(Z(test[0])(test[1]))
}

Python 3, 120 104 153 176 175 bytes
def f(n,l):
 n-=1
 if n!=4and'.'in l:l[sorted(enumerate(l),key=lambda x:abs(x[0]%3-n%3+(x[0]//3-n//3)*1j)-ord(x[1])-__import__('random').random()/9)[1][0]],l[4]='@.'
 return l

Try it online!
This method get direction and list of '.', '#' and '@'. Indexes start with 1 to 9 (with 0 to 8 in list really). So it has the form
123
456
789

Method return new list with new positions.
This line
sorted(enumerate(l),key=lambda x:abs(x[0]%3-n%3+(x[0]//3-n//3)*1j)-ord(x[1])-__import__('random').random()/9)

returns a list of this type:
>>>n=7
>>> l=['#','#','#','.','@','#','.','#','.']
>>> sorted(enumerate(l),key=lambda x:abs(x[0]%3-n%3+(x[0]//3-n//3)*1j)-ord(x[1])-__import__('random').random()/9)
[(4, '@'), (8, '.'), (6, '.'), (3, '.'), (7, '#'), (5, '#'), (1, '#'), (0, '#'), (2, '#')]

We calculate distances to free points and add randomness.
Because ord('#') <= ord('.') - 8 and ord('.') + 8 <= ord('@') we can say that the nearest '.' for n=7(index in list)  has an index of 8.

Example:
>>> f(9, ['#','.','.','.','@','#','#','.','#'])
['#', '.', '.', '.', '.', '#', '#', '@', '#']
>>> f(3, ['#','.','.','.','@','#','#','.','#'])
['#', '.', '@', '.', '.', '#', '#', '.', '#']
>>> f(5, ['.','.','#','.','@','.','#','.','#'])
['.', '.', '#', '.', '@', '.', '#', '.', '#']
>>> f(7, ['#','#','#','#','@','#','#','#','#'])
['#', '#', '#', '#', '@', '#', '#', '#', '#']
>>> f(7, ['#','.','.','.','@','#','#','.','#'])
['#', '.', '.', '@', '.', '#', '#', '.', '#'] or ['#', '.', '.', '.', '.', '#', '#', '@', '#']

This doesn't work for test cases where the direction the player wants to move in is occupied and the correct position is not the first ',' (which is the case for test cases 2, 3 and 5). 2) Your I/O format does not seem to be the same as in the question. Please mention your I/O format.

Your example f(9, ... does not work - it places the character at 2 but the closest positions to 9 are 6 and 8, so one of those should be picked at random (there is no randomness in your code either). Furthermore it should then go around the perimeter finding the next closest, so f(9,list("####@#.##")) should place the character into the only possible spot (7 here).

Thanks for pointing out mistakes
For me, the news is that code l[4],l[l.index('.')]='.@' and l[l.index('.')],l[4]='@.' are different

@JonathanAllan, at first I did not quite understand the rules. I hope I could correct the code correctly.

Still not correct, no. 1. the example f(9, ... should return list("#....##@#") (because 8 is free and next to 9). 2. Something like f(9,list("####@.#.#")) should have some chance of returning list("####..#@#") (not always list("####.@#.#")) as specified "If both of the directions are open, pick one to move to at random".

It seems to be working properly now...

authors: Кирилл Малышев

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Uniquify Identifiers
Introduction
By definition, unique identifiers should be unique.  Having multiple identifiers that are the same causes one to retrieve unexpected data.  But with data arriving concurrently from multiple sources, it can be difficult to ensure uniqueness.  Write a function the uniquifies a list of identifiers.
This is possibly the worst puzzle fluff I have written, but you get the idea.
Requirements
Given a list of zero or more positive integers, apply the following rules to each number from first to last:

If the number is the first of its kind, keep it.
If the number has previously been encountered, replace it with the lowest positive integer not found anywhere in the entire input list or any existing output.

For the solution:

The solution may be a program or a function.
The input may be a string, an array, passed as arguments, or keyboard input.
The output may be a string, an array, or printed to the screen.
All numbers in the output list are distinct.

Assumptions

The input list is clean.  It only contains positive integers.
A positive integer has the range from 1 to 231-1.
Less than 256 MB of memory is available for your program's variables.  (Basically, no 2,147,483,648-element arrays are permitted.)

Test Cases
Input:  empty
Output: empty

Input:  5
Output: 5

Input:  1, 4, 2, 5, 3, 6
Output: 1, 4, 2, 5, 3, 6

Input:  3, 3, 3, 3, 3, 3
Output: 3, 1, 2, 4, 5, 6

Input:  6, 6, 4, 4, 2, 2
Output: 6, 1, 4, 3, 2, 5

Input:  2147483647, 2, 2147483647, 2
Output: 2147483647, 2, 1, 3

Scoring
Just a simple code golf.  Lowest byte count by this time next week wins.

Add test case: 6, 6, 1, 2, 3, 4, 5 → 6, 7, 1, 2, 3, 4, 5

@Adám Shouldn't 6, 6, ... give 6, 1, ...?

@xnor No, If the number has previously been encountered, replace it with the lowest positive integer not found anywhere in the set.

@Adám I think you're right about that, but the wording could be clearer, Does "set" refer to the elements encountered, all elements of the input list, or elements in the list as it now stands?

@xnor Yes, could be clearer, but it should have said not already used if that was the case.

@xnor The 6, 6, 4, 4, 2, 2 test case confirms Adám's interpretation: the expected output is 6, 1, 4, 3, 2, 5, and not 6, 1, 4, 2, 3, 5.

Does 0 count as a positive integer for this challenge?

@Luke If it did, it'd be the first new number to show up in the test cases, and it doesn't.

Obviously, the test cases don't use it. However, it may still be acceptable if an answer uses 0.

@Luke 0 is not usually considered positive in the English language. See e.g. this Math SE question.

It's declared under Assumptions that positive integers start from 1, not 0.

I've clarified "not found anywhere in the set."  It is now "not found anywhere in the entire input list or any existing output."

Brachylog, 8 bytes
{|∧ℕ₁}ᵐ≠

Try it online!
Explanation
{    }ᵐ     Map on the Input:
              Input = Output…
 |            …or…
  ∧ℕ₁         …Output is in [1,+inf)
       ≠    All elements of the output must be different
            (Implicit labeling)

Java 8, 158 144 bytes
a->{int m=0;String r="",c=",",b=r;for(int x:a)b+=x+c;for(int x:a)if(r.contains(x+c)){for(;(r+b).contains(++m+c););r+=m+c;}else r+=x+c;return r;}

.contains(m+c);m++) to .contains(++m+c);) to save 1 byte, and simultaneously converted to Java 8 to save 13 more bytes.

Explanations:
Try it here.
a->{                      // Method with integer-array parameter and String return-type
  int m=0;                //  Lowest integer
  String r="",            //  Result-String
         c=",",           //  Comma delimiter for result String
         b=r;for(int x:a)b+=x+c;
                          //  Input array as String
  for(int x:a)            //  Loop (2) over the integers in the array
    if(r.contains(x+c)){  //   If the result already contains this integer
      for(;(r+b).contains(++m+c););
                          //    Inner (3) as long as either the result-String or array-String contains the lowest integer
                          //     and raise the lowest integer before every iteration by 1
      r+=m+c;             //    Append the result with this lowest not-present integer
    }else                 //   Else:
      r+=x+c;             //    Append the result-String with the current integer
                          //  End of loop (2) (implicit / single-line body)
  return r;               //  Return the result-String
}                         // End of method

Ruby, 63 bytes
->a{r=*0..a.size;r.map{|i|[a[i]]-a[0,i]==[]?a[i]=(r-a)[1]:0};a}

Try it online!
Explanation
->a{                                    # Anonymous function with one argument
    r=*0..a.size;                       # Numbers from 0 to array size
    r.map{|i|                           # For all numbers in range:
        [a[i]]                          #  Get array with just a[i]
              -a[0,i]                   #  Remove elements from array that are
                                        #    also in a[0..i-1]
                    ==[]?               #  Check if result is an empty array
                        a[i]=           #  If true, set a[i] to:
                             (r-a)      #   Remove elements from number range
                                        #     that are also in input array
                                  [1]   #   Get second element (first non-zero)
                        :0};            #  If false, no-op
                            a}          # Return modified array

JavaScript (ES6), 49 bytes
a=>a.map(g=(e,i)=>a.indexOf(e)-i?g(++n,-1):e,n=0)

05AB1E, 17 16 18 bytes
vy¯yåi¹gL¯K¹K¬}ˆ}¯

Try it online!
Explanation
v                    # for each y in input
 y                   # push y
  ¯yåi               # if y exist in global list
      ¹gL            # push [1 ... len(input)]
         ¯K          # remove any number that is already in global list
           ¹K        # remove any number that is in the input
             ¬       # get the first (smallest)
              }      # end if
               ˆ     # add to global list
                }¯   # end loop, push and output global list

I should probably use reduce instead of map... let me see if that helps

@LeakyNun: Reduce or map are often the way to go :)

Gives wrong result on 6, 6, 1, 2, 3, 4, 5.

Gives [6, '1', '2', '3', '4', '5', '7']. Should give [6, '7', '1', '2', '3', '4', '5'].

@Adám: Thanks for the catch! Fixed now :)

v¯yåi¯Z>LsK0èëy}ˆ for 17 bytes (I have no idea how it prints).

@carusocomputing: It implicitly prints the global list as the stack is empty. Unfortunately it has the same problem as my previous version, had as noted by Adám above.

PHP, 121 Bytes
<?$n=array_diff(range(0,count($g=$_GET)),$g);sort($n);$r=[];foreach($g as$v)$r[]=in_array($v,$r)?$n[++$i]:$v;print_r($r);

Online Version
Expanded
$n=array_diff(range(0,count($g=$_GET)),$g); # create array of ascending values which are not in input array plus zero
sort($n); # minimize keys
$r=[];  # empty result array
foreach($g as$v) # loop input array
  $r[]=in_array($v,$r)?$n[++$i]:$v; # if value is not in result array add value else take new unique value skip zero through ++$i
print_r($r); # output result array

Haskell, 79 76 bytes
EDIT:

-3 bytes: @nimi saw that head could be replaced by a pattern match.

([]#) is an anonymous function taking and returning a list. Use like ([]#)[2147483647, 2, 2147483647, 2].
(?)=notElem
s#(x:y)|z:_<-[x|x?s]++filter(?(s++y))[1..]=z:(z:s)#y
_#n=n
([]#)

Try it online!
How it works

? is an abbreviated operator for checking if an element is absent from a list.
s#l handles the list of integers l, given a list s of integers already used.

x is the next integer to look at, y the remaining ones.
z is the integer chosen for the next spot. It's x if x is not an element of s, and the first positive integer neither in s nor in y otherwise.
(z:s)#y then recurses with z added to the used integer list.
n is an empty list, since nonempty lists have been handled in the previous line.

The main function ([]#) takes a list, and calls # with it as second argument, and an empty list for the first argument.

|z:_<-[x|...]...

Python 2, 77 79 bytes
a=input();u=[];j=1
for x in a:
 u+=[[x,j][x in u]]
 while j in u+a:j+=1
print u

Takes keyboard input, like [3, 3, 3, 3, 3, 3].
Just keep track of the smallest positive integer j not used so far.  For each element x of the input, output x if x hasn't already been used, otherwise output j.  Finally, update j each time you output something.
EDITED: to fix a mistake handling input of [6, 6, 4, 4, 2, 2].  Thanks to @Rod for pointing out the mistake as well as a fix.  The mistake was that, in the event of a duplicate entry, it would output the smallest number unused to that point in the list, even if that output appeared later in the input.  (This was wrong, as clarified in the post and the comments, but I still messed it up somehow.)  Anyway, the fix was to simply add the input list, a, to the set of values that could not be output in that case.

doesn't work for [6,6,4,4,2,2], you can (probably) fix it by adding +a to the while j in u: -> while j in u+a:

@Rod You're right, my mistake.  (Somehow I still messed this up despite the comments about this--thanks for bringing it to my attention--and I also didn't test my solution well enough against the test cases. Embarrassing.)  OK, I have incorporated your very nice fix, and verified it against the test cases. Thanks!

APL (Dyalog 16.0), 34 bytes
(s↑v~⍨⍳⌈/v+s←+/b←(⍳≢v)≠⍳⍨v)@{b}v←⎕

There must be a better way.

R, 39 46 bytes

Creates a vector from the input, then replaces the duplicated values with a range from 1 to a million that has the input values removed.  Returns a numeric vector.  No input will return the empty vector numeric(0).
i[duplicated(i)]=(1:1e6)[-(i=scan())];i

Try it online!
This will throw a warning about the length of the replacement vector
                           i=scan()     # set i as input
                 (1:1e6)                # 1 to a million (could go higher)
                 (1:1e6)[-(i=scan())]   # without input values
  duplicated(i)                         # duplicate values in i
i[duplicated(i)]=(1:1e6)[-(i=scan())]   # set duplicate i values to reduced range vector
                                     ;i # return result

Pyth, 21 20 bytes

.b?}NPY@-UhlQQ=hZNQ._
m?}edPd@-SlQQ~hZed._

Test suite
I'll add an explanation when I have the time.

C, 169 bytes 133 bytes
input = array a, output = modified array a
i=1,j,k,l;void f(int*a,int n){for(;i<n;i++)for(j=i-1;j>=0;j--)if(a[i]==a[j]){l=1;for(k=0;k<n;)if(l==a[k])k=l++?0:0;else k++;a[i]=l;}}

formatted
int i, j, k, l;
void f(int* a, int n)
{
    for (i = 1; i<n; i++)
        for (j = i - 1; j >= 0; j--)
            if (a[i] == a[j])
            {
                l = 1;
                for (k = 0; k<n;)
                    if (l == a[k])
                        k = l++ ? 0 : 0;
                    else
                        k++;
                a[i] = l;
            }
}

Too many bytes wasted for these loop. Does anybody think of shorten the code by inventing a new algorithm (which use less loop)? I was thinking but havent found one.

C#, 135 bytes

Golfed
(int[] i)=>{for(int x=1,v,m=0,l=i.Length,y;x<l;x++){v=i[x];for(y=0;y<l&&v==i[x]?y<x:y<l;y++)if(i[y]==v){v=++m;y=-1;}i[x]=v;}return i;};

Ungolfed
( int[] i ) => {
   for( int x = 1, v, m = 0, l = i.Length, y; x < l; x++ ) {
      v = i[ x ];

      for( y = 0; y < l && v == i[ x ] ? y < x : y < l ; y++ )
         if( i[ y ] == v ) {
            v = ++m;
            y = -1;
         }

      i[ x ] = v;
   }

   return i;
};

Ungolfed readable
// Takes an array of Int32 objects ( 32-byte signed integers )
( int[] i ) => {

   // Cycles through each element on the array
   //   x: Scan position, starts at the 2nd element
   //   v: Value being processed
   //   m: The next minimum value to replace
   //   l: Size of the array, to save some byte count
   for( int x = 1, v, m = 0, l = i.Length, y; x < l; x++ ) {

      // Hold the value
      v = i[ x ];

      // Re-scan the array for a duplicate value up the the current position ( 'x' ) IF
      //   ... the currently hold value hasn't been modified
      //   ... otherwise, re-scans the entire array to find a suitable value to replace
      for( y = 0; y < l && v == i[ x ] ? y < x : y < l ; y++ )

         // Check if 'v' shares the same value with other element
         if( i[ y ] == v ) {

            // Set 'v' to the minimum value possible
            v = ++m;

            // Reset the scan position to validate the new value
            y = -1;
         }

      // Set the 'v' to the array
      i[ x ] = v;
   }

   // Return the array
   return i;
};

Full code
using System;
using System.Collections.Generic;

namespace Namespace {
   class Program {
      static void Main( String[] args ) {
         Func<Int32[], Int32[]> f = ( int[] i ) => {
            for( int x = 1, v, m = 0, l = i.Length, y; x < l; x++ ) {
               v = i[ x ];

               for( y = 0; y < l && v == i[ x ] ? y < x : y < l ; y++ )
                  if( i[ y ] == v ) {
                     v = ++m;
                     y = -1;
                  }

               i[ x ] = v;
            }

            return i;
         };

         List<Int32[]>
            testCases = new List<Int32[]>() {
               new Int32[] { },
               new Int32[] { 5 },
               new Int32[] { 1, 4, 2, 5, 3, 6 },
               new Int32[] { 3, 3, 3, 3, 3, 3 },
               new Int32[] { 6, 6, 4, 4, 2, 2 },
               new Int32[] { 2147483647, 2, 2147483647, 2 },
            };

         foreach( Int32[] testCase in testCases ) {
            Console.WriteLine( $" Input: {String.Join( ",", testCase )}\nOutput: {string.Join( ",", f( testCase ) )}\n" );
         }

         Console.ReadLine();
      }
   }
}

Releases

v1.0 - 135 bytes - Initial solution.

Notes

None

Python 2, 101 bytes
x=input()
for i,n in enumerate(x):x[i]=[n,list(set(range(1,len(x)+9))-set(x))[0]][n in x[:i]]
print x

Try it online! or Try all test cases

C# 7, 116 bytes
int[]f(int[]c){int j=0;int h()=>c.Contains(++j)?h():j;return c.Select((e,i)=>Array.IndexOf(c,e)<i?h():e).ToArray();}

Indented
int[] f(int[] c)
{
    int j = 0;
    int h() => c.Contains(++j) ? h() : j;
    return c
        .Select((e, i) => Array.IndexOf(c, e) < i ? h() : e)
        .ToArray();
}

Explained

first occurrence of a number is always left as-is
consecutive occurrences of a number are drawn from [1, 2, 3, ...], skipping values present in the input.

Online Version

Clojure, 72 bytes
#(reduce(fn[r i](conj r(if((set r)i)(nth(remove(set r)(range))1)i)))[]%)

A basic reduction. If i is contained in the output list so far, we'll take the 2nd element (1 when 0-indexed) from the infinite list of integers (range) from which we have removed those numbers that have already been used. Range starts from zero so we cannot take the first element but the second.

R, 74 bytes
reads the list from stdin; returns NULL for an empty input.
o=c();for(i in n<-scan())o=c(o,`if`(i%in%o,setdiff(1:length(n),o)[1],i));o

explanation:
o=c()                                #initialize empty list of outputs
for(i in n<-scan())                  # loop through the list after reading it from stdin
    o=c(o,                           # set the output to be the concatenation of o and
      `if`(i%in%o,                   # if we've seen the element before
           setdiff(1:length(n),o)[1] # the first element not in 1,2,...
           ,i))                      # otherwise the element
o                                    # print the output

1:length(n) may be used since we are guaranteed to never need a replacement from outside that range.
Try it online!

Axiom, 169 bytes
f a==(r:List INT:=[];for i in 1..#a repeat(~member?(a.i,r)=>(r:=concat(r,a.i));for j in 1..repeat if~member?(j,r)and(~member?(j,a)or j=a.i)then(r:=concat(r,j);break));r)

ungolf and result
ff(a)==
  r:List INT:=[]
  for i in 1..#a repeat
      ~member?(a.i,r)=>(r:=concat(r,a.i))
      for j in 1.. repeat
            if~member?(j,r)and(~member?(j,a) or j=a.i)then(r:=concat(r,j);break)
  r

(3) -> f([])
   (3)  []
                                                       Type: List Integer
(4) -> f([5])
   (4)  [5]
                                                       Type: List Integer
(5) -> f([1,4,2,5,3,6])
   (5)  [1,4,2,5,3,6]
                                                       Type: List Integer
(6) -> f([3,3,3,3,3,3])
   (6)  [3,1,2,4,5,6]
                                                       Type: List Integer
(7) -> f([6, 6, 4, 4, 2, 2])
   (7)  [6,1,4,3,2,5]
                                                       Type: List Integer
(8) -> f([2147483647, 2, 2147483647, 2])
   (8)  [2147483647,2,1,3]
                                                       Type: List Integer


text:
Halve the falses
Task
Given a non-empty array of 0 and 1, halve the lengths of the runs of 0.
Input
An array of 0 and 1. Acceptable format:

Real array in your language
Linefeed-separated string of 0 and 1
Contiguous string of 0 and 1
Any other reasonable format

For example, the following three inputs are all acceptable:

[1, 0, 0, 1]
"1\n0\n0\n1" (where \n is a linefeed U+000A)
"1001"

You may assume that the runs of 0 will have even length.
Output
An array of 0 and 1, in the acceptable formats above.
Testcases
input ↦ output
[1,0,0,1,0,0,1] ↦ [1,0,1,0,1]
[1,1,0,0,1,1,0,0,1] ↦ [1,1,0,1,1,0,1]
[1,1,0,0,1,1,1,0,0,1,1] ↦ [1,1,0,1,1,1,0,1,1]
[1,1,1] ↦ [1,1,1]
[0,0,1] ↦ [0,1]
[0,0] ↦ [0]
[1,1,1,0,0,0,0,1,1,1,1,0,0,1,0,0,1,1,0,0,1,1,1,1,0,0,1,0,0] ↦ [1,1,1,0,0,1,1,1,1,0,1,0,1,1,0,1,1,1,1,0,1,0]

Scoring
This is code-golf. Shortest answer in bytes wins.
Standard loopholes apply.

In the last testcase, don't the runs of zeroes not have even length?

@OldBunny2800 Read the test case carefully; the 0-runs have lengths 4, 2, 2, 2, 2, and 2.

Can we take true and false instead of 1 and 0?

@Cyoce which language?

@LeakyNun Ruby, which considers 0 to be truthy.

@Cyoce I suggest not.

@HyperNeutrino oh, I took "even" to mean "the same length", not "mathematically even" lol

Can we use different input and output formats?

@Challenger5 I don't see any point to that, but yes.

@LeakyNun It helps with CJam because arrays are displayed with all their elements concatenated together, and it would cost me a byte to uneval.

Retina, 4 bytes
00
0

Try it online!

This one will be hard to beat.

@Adám I'd say impossible to beat.

Works in QuadR too!

05AB1E, 5 bytes
00¤.:

Try it online!
Explanation
00     # push 00
  ¤    # tail, pushes 0
   .:  # replace

That was easy; why didn't I think of that?

00 is weird behavior...

@EriktheOutgolfer: Sequential digits are concatenated to form a number, so 11 is eleven and not 1,1. A side effect of that is that 00 becomes 00 instead of 0,0 :)

@Emigna I'd have expected it to become 0 or 0 0 instead, but whatever.

¤ can also be N

Haskell, 33 bytes
f(0:0:r)=0:f r
f(x:r)=x:f r
f e=e

Try it online! Usage: f[1,1,0,0,1,1,0,0,1]. Iterates over the list and replaces two consecutive zeros by one zero.

I feel that this can be forked to Prolog

C (gcc), 35 bytes
f(char*s){while(*s)putchar(*s),*s++-48?:s++;}

48 is the ascii code of '0'
better version  43 bytes as suggested by Neil
f(char*s){while(*s)putchar(*s),s+=2-*s%2;}

another one 40 byte this time (again as suggested by  Neil &  VisualMelon) :)
f(char*s){for(;*s;s+=50-*s)putchar(*s);}

and then 35 bytes thanks to Khaled.K
f(char*s){*s&&f(s+50-putchar(*s));}

Try it online!

Would s+=2-*s%2 work?

yes it would, thanks I'll edit the response accordingly

If I've counted correctly I think for(;*s;s+=2-*s%2)putchar(*s); saves another byte.

What would be wrong with s+=50-*s?  Not done C for ages and don't want to embarrass myself by invoking undefined behaviour (coming from C# where there is none)

Looking at the putchar docs, can you do f(char*s){for(;*s;s+=50-putchar(*s));} ?

You can save 5 bytes by making it recursive f(char*s){*s&&f(s+50-putchar(*s));}

sed, 8 bytes
s/00/0/g

Try it online!

@boboquack Doesn't work, since it would always replace a run of 0s with 0.

@EriktheOutgolfer No, it does just halve the length of runs of 0's: https://tio.run/##K05N@f@/WN/AQN9AP/3/fwMwAAA

Octave, 22 bytes
@(s)strrep(s,'00','0')

Verify all test cases here.
This is an anonymous function taking a string on the format '1001000011' as input, and replaces two consecutive zeros with a single zero.

Haskell, 28 bytes
f(h:t)=h:f(drop(1-h)t)
f e=e

Try it online!
Recursively takes the first element, dropping the second one if the first one is zero, until the list of empty. If the first entry is h, then the first 1-h are dropped from the remainder.

Java, 50 bytes
String f(String s){return s.replaceAll("00","0");}

Try Online

A very good input choice! By the way, if you're interested in switching to a Java 8+ solution, you could use a lambda: s->s.replaceAll("00","0").

Even better, use replace instead of replaceAll to save 3 bytes

@BenjaminUrquhart replace will only replace the first occurrence

@Khaled.K in javascript, yes. In java, it replaces all occurrences

@BenjaminUrquhart is indeed correct, both replace and replaceAll replace all occurrences. The difference is that replaceAll supports regex. To replace the first occurrence there is the replaceFirst method (also supporting regex). I personally think Java's replace is the worst-named method there is in Java. Better would be if replace was called replaceAll and replaceAll was called replaceAllWithRegex or something along those lines.. :/

Japt, 7 6 5 bytes
d'0²0

Try it online!
Simply replaces each run of two zeroes in the input by one zero. Uses string input (i.e. "1001001").

Nice! You don't even need the ' I think

Ooh, you can save another byte by replacing "00" with '0² :-)

Well, that's weird. Thanks though!

Husk, 4 bytes
fG=¹

Try it online!
How?
The Husk scanl command (G) applies a function to each element of a list and the result-so-far.  The initial result-so-far is set to the first element.
In this case, used with the eq (=) function, it checks whether each element is equal to the result-so-far.  For runs of 1, this will always output 1 (truthy).  Now, the first of any run of 0s will be 0 (falsy), of course; then, the next result will be 1 (since 0 is equal to the result-so-far), and then 0, and so on, alternating 0s at odd positions in the run and 1s at even positions, until the end of the run.  Since there are always an even number of 0s in each run, then last result-so-far must be 1: so, when we enter the next run of 1s, the first result will be 1 (truthy) again, and so on...
So: runs of 0s get alternating 0 and 1, and runs of 1s always get 1, and we just need to filter (f) the input list (¹) by this.

V, 4 bytes
òf0x

Try it online!
ò    ' Recursively (until we error)
 f0  ' Go to the next zero (errors when there are no zeros left)
   x ' Delete it

Jelly, 8 bytes
ṣ1j1,1m2

Try it online!
Possibly other answers in languages without a .replace() or similar could use this trick.
Explanation
ṣ1j1,1m2 - (duplicates the 1s, then halves all lengths)
ṣ1       - split by the element 1
  j1,1   - join the elements with the two-element list 1,1
      m2 - get every second element

Perl 5, 7+1(-p flag)=8 bytes
<>if/0/

Takes input as newline separated numbers. Skips the next line if it sees a zero.

sed, 8 6 bytes
n;/0/d

Try it online!
Takes a linefeed-separated string of 0 and 1.
n skips a line, and /0/d deletes a line if it has a zero in it. This has the net effect of deleting every 0 on an even-numbered line. Since any even-length contiguous list of 0 has the same number of even-numbered and odd-numbered lines, this has the effect of halving the length of every run of 0.

Alice, 13 bytes
/oe00/
@iS0e\

Try it online!
Explanation
/.../
@...\

This is a simple template for linear programs which operate entirely in Ordinal mode. The initial / reflects the IP to move south east and then it bounces diagonally up and down through the code until the mirrors at the end. Those simply offset the position by one so that on the way back the IP traverses the remaining cells. Reading the code in this zigzag fashion it becomes:
ie00e0So@

This is a simple string substitution:
i   Read all input.
e   Push an empty string.
00  Append two zeros to create the string "00".
e   Push an empty string.
0   Append a zero to create the string "0".
S   Substitute all occurrences of "00" in the input with "0".
o   Output the result.
@   Terminate the program.

There are a few other ways to push the two strings, e.g. '00'0 or e000t, but I haven't found anything that beats 5 bytes there (and I'd have to shave off two bytes to be able to shorten the program).

Looks like you fell in love with Alice recently...

@LeakyNun Please don't tell my wife...

@MartinEnder I'm gonna tell that to Mrs. Ender!

Jelly, 4 bytes
¹‘ƭƇ

Try it online!
Explanation
¹‘ƭƇ   Main monadic link
   Ƈ   Filter by
  ƭ      Every time this is called, switch between
¹          doing nothing and
 ‘         adding 1

Lua, 33 bytes
print((io.read():gsub("00","0")))

Takes a string via input and condenses double zeros. Easy.

Alice, 12 10 bytes
2 bytes saved thanks to Martin Ender
i.h%.7%$io

Try it online!
Explanation
This is a 1-D code operating in cardinal mode, so it's easy to follow its flow:
i                   Read a byte from input (pushes -1 on EOF)
 .h                 Duplicate it and add 1 to the copy
   %                Compute n%(n+1). This will exit with an error on n==-1
                    and return n for any non-negative n.
    .7%             Duplicate the input again and compute its value modulo 7
                    This returns 6 for '0' (unicode value 48) and 0 for '1'
                    (unicode value 49)
       $i           If this last result was not 0, input another number.
                    This ignores every other '0' in the input
                    and moves to the following number (another '0')
         o          Output the last byte read

                    At the end, wrap back to the beginning of the line

You can actually save two more bytes with i.h%...

@MartinEnder you're an evil person, going around teaching people to play dirty... :D

Prolog (SWI), 42 bytes
[0,0|T]*[0|R]:-T*R.
[H|T]*[H|R]:-T*R.
H*H.

Try it online!

A prolog answer, but not what I expected...

Nice trick to use the * operator.

PHP, 26
<?=strtr($argn,["00"=>0]);

simply replace all 00 by 0.

MATL, 5 bytes
FFOZt

Try it online!
Explanation
This is similar to Stewie Griffin's Octave answer:
FF     % Push [0 0]
O      % Push 0
Zt     % Implicitly take input. Replace [0 0] by 0. Implicitly display

8 bytes
vy~f2L)(

This avoids the string/array replacement builtin.
Try it online!
Explanation
Consider input [1,0,0,1,0,0,1] as an example:
v      % Concatenate stack (which is empty): pushes []
       % STACK: []
y      % Implicit input. Duplicate from below
       % STACK: [1,0,0,1,0,0,1], [], [1,0,0,1,0,0,1]
~f     % Negate, find: gives indices of zeros
       % STACK: [1,0,0,1,0,0,1], [], [2,3,5,6]
2L     % Push [2,2,1i]. As an index, this is interpreted as 2:2:end
       % STACK: [1,0,0,1,0,0,1], [], [2,3,5,6], [2,2,1i]
)      % Reference indexing. This selects the even-indexed entries
       % STACK: [1,0,0,1,0,0,1], [], [3,6]
(      % Assignment indexing. This deletes the specified entries
       % (assigns them the empty array). Implicitly display
       % STACK: [1,0,1,0,1]

Mathematica, 24 bytes
StringReplace["00"->"0"]

A function that expects a string of "0"s and "1"s and returns a similar string. Self-explanatory syntax. Mathematica has lots of transformation builtins; the key is to use one that transforms every relevant subexpression (unlike /.) but only passes through the expression once (unlike //.).

JavaScript (ES6), 26 21 bytes
Takes the input as a string and returns a string.
s=>s.replace(/00/g,0)

Try It

f=
s=>s.replace(/00/g,0)
i.addEventListener("input",_=>o.innerText=f(i.value))
console.log(f("1001001")) // "10101"
console.log(f("110011001")) // "1101101"
console.log(f("11001110011")) // "110111011"
console.log(f("111")) // "111"
console.log(f("001")) // "01"
console.log(f("00")) // "0"
console.log(f("11100001111001001100111100100")) // "1110011110101101111010"
<input id=i><pre id=o>

Java, 131 123 bytes
int[]f(int[]a){int c=0,i=0,l=a.length;for(int x:a)c+=1-x;int[]r=new int[l-c/2];for(c=0;c<l;c+=2-a[c])r[i++]=a[c];return r;}

Try it online!

Pip, 5 bytes
aR00i

Takes a string of 0s and 1s. Try it online!
Explanation
Beating Jelly? Inconceivable!
a      Take the first command-line argument
 R     and replace
  00   00 (an integer literal, so it doesn't need quotes)
    i  with i (variable preinitialized to 0)
       Autoprint

Not beating Jelly anymore ;)

R, 21 bytes
function(n)n[n+1:0>0]

Try it online!

Ah, this better leverages the fact that runs of zero are even length! Very nice.

Vyxal, 4 bytes
ɖ=Tİ

Try it Online! Port of Dominic van Essen's Husk answer. See that for a more detailed explanation of how this works.
ɖ    # Scan by
 =   # Equal to the current result?
     # For runs of 1s, this is 1,
     # For runs of 0s this alternates between 1 and 0
  Tİ # Keep only items wihtt a 1 in the previous list

Ruby, 41 40 bytes
->a{a.each_index{|i|a[i]>0||a[i..i]=[]}}

Jelly, 10 bytes
Œg¹m2$S?€F

Try it online!
Explanation
Œg¹m2$S?€F
Œg          - Group runs of equal elements
        €   - To each run...
      S?    - If sum is truthy,
  ¹         -   return the run as it is
   m2$      - Else return every second element of the run.

Brachylog, 10 bytes
ḅ{cẹ|ḍh}ᵐc

Try it online!
Not sure this is optimal yet…
Explanation
This exploits the bug that c on a list of integers that has leading zeroes will fail.
ḅ               Blocks; group consecutive equal elements together
 {     }ᵐ       Map on each block:
  c               It is possible to concatenate the block into an int (i.e. it contains 1s)
   ẹ              Split it again into a list of 1s
    |             Else
     ḍh           Dichotomize and take the head
         c      Concatenate the blocks into a single list

How is that a bug?

@LeakyNun We should be able to concatenate [0,0,4,2] into 42. Leading zeroes make it fail right now because it's here to prevent infinite leading zeroes when the Input is a variable, but here the Input is fully grounded so that limitation shouldn't exist.

Would you write a Prolog answer?

Python (list I/O), 36 bytes
f=lambda l:l and l[:1]+f(l[2-l[0]:])

Try it online!
Recursively takes the first element, then removes the remaining one if the first one was zero.

38 bytes:
lambda l:eval(`l`.replace('0, 0','0'))

Try it online This takes a Python list and outputs a Python list by doing replacement on its string representation. String I/O would allow a more direct and shorter solution, such as
lambda s:s.replace('00','0')

for '1001'  format.

The first answer with format specified, nice.

String I/O is allowed. lambda s:s.replace('00','0') should be fine.

///, 11 bytes
/00/a//a/0/<input goes here>

Try it online!
Fun fact: /00/0/<input> won't work, because it reduces 0000 to 0. Hence the a-substitute.

Batch, 24 bytes
@set/ps=
@echo %s:00=0%

Takes input on STDIN. Somewhat competitive for once.

APL (Dyalog), 9 bytes
'00'⎕R'0'

Try it online!

It says DOMAIN ERROR: I-Beam function 7160 has been withdrawn

Common Lisp, SBCL, 48 32 bytes
-16 bytes thanks to Julian Wolf
(format t"~{~[0~*~;1~]~}"(read))

input:
(1 0 0 0 0 1 1 1 0 0)

output:
1001110

Explanation
We read input list.
List is used in format function.
We loop through it outputting 1 if element is 1 and outputting 0 and skipping next element of list for 0.

Using ~[ rather than ~:[ lets you index with 0 and 1 directly, which should save you a bunch of bytes

@JulianWolf Thank you!

BitCycle, 18 17 15 bytes
Saved 2 bytes via a clever rearrangement by Jo King
?ABv
  +\!
 ^\<

Try it online!
Algorithm
Take two bits of the input at a time. Output the first one. Discard the second one if it is 0 and output it if it is 1.
Because we are guaranteed that all runs of 0s have even length, this approach will always discard half of the 0s from each run:
00 -> 0x
10 01 -> 1x 01
10 0  -> 1x 0

Implementation
The input bitstring comes in at the source ? and is directed into the A collector, which in turn dumps its output into the B collector. Each time the B collector opens, the bits are directed through the two splitters \, which split off the first and second bits. The first bit goes east, straight into the sink ! to be output. The second bit passes through the now-deactivated first splitter, hits the second splitter, and goes north into the +, which sends a 0 bit left (west) and off the playfield, but sends a 1 bit right (east) into the sink ! to be output.
Meanwhile, the rest of the bits pass through both splitters and back into the A collector. Once they are all there, A opens and the cycle starts over. This loop continues until all bits are disposed of.

@JoKing And here I thought I had it as tight as possible! How are you so good at this language? :^D

Husk, 8 7 bytes
ṁ?IĊ2←g

Try it online!
might be shorter with strings.
-1 byte from Zgarb.
Explanation
ṁ?Io←½←g
       g group equal runs of elements
ṁ        map each group to function, and concatenate
 ?    ←  if first element is truthy
  I      leave as is
   o←½   else remove the second half

You can use Ċ2 to remove every second element.

@JoKing updated

Factor, 18 bytes
[ "00""0"replace ]

Try it online!

R, 29 bytes
function(n)n[n|cumsum(!n)%%2]

Try it online!
Input as list of 0 and 1 or T/F

Excel, 24 22 bytes
Saved 2 bytes thanks to Taylor Raine seeing what should have been obvious.
=SUBSTITUTE(A1,"00",0)

Inputs is a contiguous string of 0 and 1 in cell A1. Output is wherever the formula is.
Straightforward use of a built-in.

If the output has to be an array even though the input isn't, the formula grows to 55 bytes.
=LET(a,SUBSTITUTE(A1,"00",0),MID(a,SEQUENCE(LEN(a)),1))

If the output has to be an array but it can have trailing empty space, it's 47 bytes.
=MID(SUBSTITUTE(A1,"00",0),SEQUENCE(LEN(A1)),1)

Drop the "s around the third argument for -2 bytes

Vyxal, 6 5 bytes
\0d0V

Try it Online!
-1 thx to @Steffan

\00`=>‛00(or\0d`)

Thunno 2, 5 bytes
`000v

Attempt This Online!
Explanation
`000v  # Implicit input
`00    # Push "00"
   0   # Push 0
    v  # Replace "00" with "0"
       # Implicit output

Nekomata, 4 bytes
ĭZĬ‼

Attempt This Online!
ĭZĬ‼        Take [1,0,0,1,0,0,1] as an example
ĭ       Uninterleave
            [1,0,0,1,0,0,1] -> [1,0,0,1] [0,1,0]
 Z      Check non-zero
            [0,1,0] -> [Failure,1,Failure]
  Ĭ     Interleave
            [1,0,0,1] [Failure,1,Failure] -> [1,Failure,0,1,0,Failure,1]
   ‼    Remove failures
            [1,Failure,0,1,0,Failure,1] -> [1,0,1,0,1]

The idea is to remove all zeros at odd positions (0-based).
The code makes use of the fact that Nekomata is lazy: Z will not fail immediately when it sees a zero, but only replace it with a "failure", that is, a nondeterministic object that has no value. Lists that contain failures can be used in most operations just like normal lists, and will only fail when they are printed as the final result. So we can safely interleave it with the original even-indexed part, and then remove all failures.

Python 2, 84 68 bytes
Not nearly as short as xnor's answer, but that's okay. I wanted to use del.
L=input()
i=0
while i<len(L):
 if L[i]<1:del L[i]
 i+=2-L[i]
print L

Try it online

73 bytes

68 bytes

Pyth, 12 bytes
s.e?sbb*%k2b

Try this
Takes a quoted string.
I know there's a shorter Pyth answer already, but I thought someone might find this approach interesting/useful.
Explanation
s.e?sbb*%k2b
 .e         Q  # enumerated map on the implicit input string. b=element; k = position
   ?sb         # Is that character nonzero? (Done by converting char to int.)
      b        # If yes, just return that character
        %k2    # Mod 2 of the position: 0 if even 1 if odd
       *   b   # Take b that many times: "" if even, "0" if odd
s              # Concat everything.

So every even "0" gets replaced by "".
Similar, 13 bytes (12 bytes if it weren't for Pyth's unfortunate naming of map variables):
s.e?+%k2sbb""

Try that

The other takes in string so it isn't interesting, and this one can potentially take in a list...

CJam, 20 18 bytes
1l~]e`2/z~2ff/]z:~

Expects input as a list of bits, separated by spaces.
Explanation:
1   e# Push 1:              | 1
l   e# Read line:           | 1 "1 1 0 0 1 1 1 0 0 1 1"
~   e# Evaluate:            | 1 1 1 0 0 1 1 1 0 0 1 1
]   e# Wrap stack in array: | [1 1 0 0 1 1 1 0 0 1 1]
e`  e# Run-length encode:   | [[3 1] [2 0] [3 1] [2 0] [2 1]]
2/  e# Group by 2:          | [[[3 1] [2 0]] [[3 1] [2 0]] [[2 1]]]
z   e# Transpose:           | [[[3 1] [3 1] [2 1]] [[2 0] [2 0]]]
~   e# Unpack array:        | [[3 1] [3 1] [2 1]] [[2 0] [2 0]]
2ff/ e# Divide each by 2:   | [[[3 1] [3 1] [2 1]] [[1 0] [1 0]]]
]   e# Wrap stack in array: | [[[[3 1] [3 1] [2 1]] [[1 0] [1 0]]]]
z   e# Transpose:           | [[[3 1] [1 0]] [[3 1] [1 0]] [[2 1]]]
:~  e# Unpack each:         | [[3 1] [1 0] [3 1] [1 0] [2 1]]
e~  e# RLE decode:          | [1 1 1 0 1 1 1 0 1 1]
(;  e# Delete last element: | [1 1 0 1 1 1 0 1 1]
e# Implicit output: "110111011"

Alternative (9 bytes):
l~[0_]/0*

Expects input as a CJam list literal.
Explanation:
l~   e# Read line and eval: | [1 1 0 0 1 1 1 0 0 1 1]
[0_] e# Push [0 0]:         | [1 1 0 0 1 1 1 0 0 1 1] [0 0]
/    e# Split array:        | [[1 1] [1 1 1] [1 1]]
0*   e# Join with 0:        | [1 1 0 1 1 1 0 1 1]

C#, 191 bytes
string a(string s){var l=(s+'1').ToCharArray();s="";int b=0;for(int i=0;i<l.Length;i++){if(l[i]=='1'){if(b>0){s+=new string('0',b/2);b=0;}s+=l[i];}else b++;}return s.Substring(0,s.Length-1);}

Try it online!
It's neither clean nor short, but it works.
Takes input as a contiguous string of characters, outputs in the same format
Explanation:
string a(string s){                  //Define method a that takes input string s and returns a string
  var l=(s+'1').ToCharArray();       //Add a 1 to the end of s and split into char array l
  s="";                              //Empty s
  int b=0;                           //Initialize int b with value 0
  for(int i=0;i<l.Length;i++){       //Loop through l
    if(l[i]=='1'){                   //If current char is 1
      if(b>0){                       //If b is not 0
        s+=new string('0',b/2);      //Add half the amount of 0s we've counted to s
        b=0;                         //Reset b
      }                              //End if b is not 0
      s+=l[i];                       //Add current char to s
    }                                //End if current char is 1
    else b++;                        //If current char is not 1, increment b
  }                                  //End loop
  return s.Substring(0,s.Length-1);  //Return string minus last char
}                                    //End method

Note
Yes I am aware this could simply be done using s.Replace("00","0"), my aim was to avoid using the obvious solution. After all, the whole point of PPCG is to have fun, right? ;)

@Mr.Xcoder That's not true. This is about as golfed as you can get without using the language's built-in Replace
I'm using C# so I'm under no delusions about getting the shortest possible code, especially with languages like Jelly around, so might as well have a little fun in the process.

of course fun is important as well. I apologise for the comment above and I must admit I liked your answer myself (the technique you used).

@Mr.Xcoder no hard feelings, ultimately we're all here to have fun and flex our otherwise useless ability to compress code as much as possible ;)

You can do a lot shorter than this without replace! string a(string s){var r="";for(int i=0;i<s.Length;i+=50-s[i])r+=s[i];return r;}   (looks like this is basically the C answer)

Swift - 65 bytes
func g(a:String){print(a.replacingOccurrences(of:"00",with:"0"))}

Usage: g(a:"100100"), obviously the I/O method is through strings.

You can save a bunch of bytes using a closure: {$0.replacingOccurrences(of:"00",with:"0")}. Swift 5.7 added a bunch of string processing utilities and maybe one of those is shorter yet, but I recognize they didn't exist when you wrote this.

Pyth, 8 bytes
:z"00"\0

Try-it link.
Explanation:
:z"00"\0 Takes unquoted contiguous 1-line input.
 z       Initialized to unevaluated first input line (Q won't be any shorter)
  "00"   Matching regex pattern /00/g
      \0 Substitution string "0"
:        Regex find-and-replace

Perl 5 8 + 1 (for -p flag) = 9 bytes
s/00/0/g

I made another answer because I liked my first one too much :)

I count 8 Bytes (+1 for the fag = 9)

@Kevin You're right.  Must have miscounted.  Thanks

Awk - 18 bytes
First try doing anything with Awk so it might be possible to golf it more.
{gsub(00,0);print}

Usage: echo "1001001" | awk '{gsub(00,0);print}'

ES7, 23 bytes
_=>_.replace(/00/g,`0`)

Input is string without whitespace + it allows odd lengths of runs of 0, it just keeps it as is.

Zsh, 13 bytes
<<<${1//00/0}

Try it online!

x86-16 machine code, 15 bytes
00000000: b401 aca8 0175 04f6 dc78 01aa e2f4 c3    .....u...x.....

Listing:
B4 01       MOV  AH, 1          ; set zero run counter flag set to positive
        CLOOP:
AC          LODSB               ; load next byte
A8 01       TEST AL, 1          ; is a 1 or 0?
75 04       JNZ  IS_ONE         ; if 1, store to output and loop
F6 DC       NEG  AH             ; flip sign of zero run counter flag
78 01       JS   ODD_ZERO       ; if negative, don't output
        IS_ONE:
AA          STOSB               ; copy char to output
        ODD_ZERO:
E2 F4       LOOP CLOOP          ; loop until end of input
C3          RET                 ; return to caller

Callable function, input array at [SI], len in CX.  Output to array at [DI].
Test program output:

Try it online!

11

Brainfuck, 51 bytes
+[,[>+>+<<-]>>[.>+++++++[<------->-]<[,>]]<[<+>-]<]

Try It Online!
This program takes a string of 0's and 1's as input and prints a string of 0's and 1's as output.

Husk, 6 bytes
σD;0;0

Try it online!
Explanation
σD;0;0
σ       replace all                 with
 D                  2 copies of
  ;0                            [0]
    ;0                                   [0]

5: Try it online!

Pari/GP, 21 bytes
a->[i|i<-q=a,i||q=!q]

Try it online!

brainfuck, 23 bytes
,[.++[->+++++<]>+[,>],]

Try it online!
,[         while(c=getchar()) {
  .++[       putchar(c);
    ->+++++< e=5*(c+2)
  ]
  >+[        if(e!=-1) {
    ,>         getchar();
  ]          }
,]         }

Lexurgy, 10 bytes
Input is a string of as and bs, where a is 1 and b is 0.
Finds two bs and replaces them with a b and an empty string.
a:
b b=>b *

Variant that does the same thing with actual 0 and 1 digits (12 bytes):
a:
\0\0=>\0 *

convey, 32 bytes
{">>>v
 "+."@}
1#,0=]
^>@<<
^<$1

Try it online!
How it works with input [1,0,0,0,0,1]:

APOL, 33 bytes
j(ƒ(i ¿(!(I(∋)) ¿(≐(∈) 0 '') 1)))
Explanation:
j(            Join list to string
  ƒ(          List-builder for
    i         Get input
    ¿(        Returning if
      !(      Not
        I(    As number
          ∋   Loop item
        )
      )
              If true return
      ¿(      Returning if
        ≐(∈)  Loop counter is even
        0     If true return 0
        ''    Else return an empty string
      )
      1       Else return 1
    )
  )
)

Julia, 21 bytes
!x=replace(x,"00"=>0)
Attempt This Online!

Wolfram Language (Mathematica), 22 bytes
Select[#>=(i=-i)&]
i=1

Try it online!

Desmos, 28 bytes
f(L)=L[(L-1)^{[0...9999]}<1]

Takes input as a list of 0s and 1s, and returns a list of 0s and 1s.
This works by filtering for elements that are either 1, or 0 and with odd (0-based) index in the list.
Desmos lists have a maximum length of 10000 elements, so [0...9999] is a valid golf from [0...L.length].
Try it on Desmos!

AWK, 8 bytes
$0||NR%2

Try it online!
I found this nice solution following the thinking of this answer.
It's a simple OR gate used as a AWK pattern: it prints the line if the input is true (i.e., 1) or it's an odd line (NR is the number of the line). It will skip only the 0 in even lines.
AWK, 15 bytes (former answer)
gsub("00","0")1

Try it online!
Globally substitutes all "00" strings to "0". The 1 in the end is a True token to force printing the line if there were no substitutions.

Octave, 25 bytes
@(a)a(~mod(cumsum(~a),2))

Try it online!
Find the indices of even elements in the cumsum of the logical negation of the input.

Uiua, 4 bytes
▽\=.

Try it!
Port of emanresu A's Vyxal answer.
▽\=.
   . # duplicate
 \=  # scan by equality
▽    # keep

Perl 5 50 + 1 (for -p flag) = 51 bytes
@a=split'',$_;splice@a,$i++,!$_ for@a;$_=join'',@a


text:
Is it a bird, is it a plane?
Challenge
Supplied an image, you must determine if the subject of the image is a bird or a plane.
If the image is a bird, your program must output
bird

and if the image is a plane, your program must output
plane

Your program must produce no other output and the testing program will be case sensitive.
Further information
All images will be the objects in flight.
The images of planes and birds will be against blue backgrounds (in some there may be light cloud in patches).
All birds will be pictured gliding from underneath, with their wings spread open. They will not always be the same species.
All planes will be commercial jetliners, pictured from the side. Their liveries may differ and the models will not be the same.
You may not use any external libraries, functions or online resources which perform image recognition.
The images will not be revealed to the competitors.
Examples
The following examples will not be used in the 30 test images.
Birds

Planes

Winning
Given 60 images of birds and planes, the program which identifies the most of then correctly wins.
In case of a tie, first post wins.
Note:
Thank you to Beta Decay for writing this challenge! Beta allowed me to take it and post. Sandbox

Hello, I will not be on until ~11 EST so please be patient with questions.

I think this problem is too complicated for a code golf. But good luck.

@hucancode This is not code golf. Also if you think that look of the Game Of life Clock

An airplane looks surprisingly much like a bird flying sideways.

@hucancode I would tend to agree with you. But then I remember this challenge (and specially the Mathematica answer)

Not really a good idea to post a challenge when you can't answer any questions about it. I like the challenge, but I think there is important information missing about what images we can expect. Specifically with regards to the birds. You say there can be different species, but you don't say anything about what species we might get. The differences between various types of birds are huge. I voted to close this for now, but I'm happy to retract that vote once you have clarified this. :)

What should the output be for these? ;)

Since you took this from the sandbox without modification, do you even have the 30 test images?

@MartinEnder I am creating the list now. I will also ask beta about them

@StewieGriffin I will crop the images so they almost fit the box as said. but they will not always stretch one way. The planes will always be horizontal as I need images from the side

For later reference: There's a reason why those challenges are where they are. Most need some substantial improvement to be made into full challenges, and it's best to try to work that out before you post.

You should already have the 30 images before creating the challenge, and provide a way to prove that you already do (hash of a zip archive or something). Also, I don't think 30 is enough. As it is, luck will probably play a factor in picking a winner.

@Dennis I will work on that. 60 images?

The more the merrier.

@Dennis sounds good!

Shortest code as a tie-breaker in a code-challenge is not a great idea. Also, I'm sure most will get (close to) 100% success-rate. Two parallel lines are easy to detect, and if those aren't present then you can go for the windows (small boxes on a straight row). If there are airplanes that don't have the same shape as the ones in the picture then you should inform about this and show an example.