text:
Maintain Social Distancing!
Task
Given the situation with this global pandemic, you've been enlisted to help maintain social distancing. Your challenge, should you choose to accept it, is to write a program that takes in the positions of a group of people and checks whether the group is following social distancing rules. Your program must output a truthy value if social distancing guidelines are being met else output a falsy value.
People must always be six spaces apart:
[[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]] -> True

[[1, 0, 0, 0, 0, 0, 0, 1]] -> True

[[1, 0, 0, 0, 0, 0, 1]] -> False

[[1, 0, 0, 1]] -> False

[[1],
 [0],
 [0],
 [0],
 [0],
 [1]] -> False

[[1],
 [0],
 [0],
 [0],
 [0],
 [0],
 [0],
 [1]] -> True

For the purpose of this challenge, instead of measuring distance with Pythagoras's theorem, we measure the distance as the length of the shortest path between two people, so this example outputs true:
[[1, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 1,]] -> True

Since the shortest path passes through at least six squares.
[[1, █, █, █, █,],
 [0, 0, 0, 0, █,],
 [0, 0, 0, 0, █,],
 [0, 0, 0, 0, 1,],]

Your algorithm must be deterministic (i.e., always produce the same output).
Your program should also, at least in theory, work for inputs containing more than five people and needs to work for a two dimensional input.
Input and Output
Your input can be the a nested array in STDIN or any other input format that doesn't break the standard loopholes.
Output has to be written to STDOUT or closest alternative. Output should consist of a truthy or falsy value (or a string representation thereof).
Additional Rules and Examples
[[1, 0, 0, 0, 0, 0, 1, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 1, 0, 0, 0, 0, 0, 1,]] -> False

[[1, 0, 0, 0, 0, 0, 0, 1, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 1, 0, 0, 0, 0,]] -> True

[[1, 0, 0, 0, 0, 0, 0, 1, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 1, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [1, 0, 0, 0, 0, 0, 0, 0, 1,]] -> True

[[1, 0, 0, 0, 0, 0, 0, 1, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 1, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 1, 0,],
 [0, 1, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 1, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 1, 0,],
 [0, 0, 0, 1, 0, 0, 0, 0, 0,],
 [0, 0, 0, 0, 0, 0, 0, 0, 0,],
 [1, 0, 0, 0, 0, 0, 0, 0, 1,]] -> False

Submissions in most languages will be scored in bytes in an appropriate preexisting encoding, usually (but not necessarily) UTF-8.
The language Piet, for example, will be scored in codels, which is the natural choice for this language.
Some languages, like Folders, are a bit tricky to score. If in doubt, please ask on Meta.
If your language of choice is a trivial variant of another (potentially more popular) language which already has an answer (think BASIC or SQL dialects, Unix shells or trivial Brainfuck derivatives like Headsecks or Unary), consider adding a note to the existing answer that the same or a very similar solution is also the shortest in the other language.
Unless they have been overruled earlier, all standard code-golf rules apply.

I've removed my comment asking you not to assume that I/O is processed through STDIN/STDOUT exclusively, because you do mention or closest alternative. Still, you should just rely on our default rules rather than re-writing them. Nice first challenge anyway!

Consider converting your test cases to valid JSON (without trailing ,s in lists).

Is [[2]] a valid input?

FWIW, the way you calculate the distance is called Manhattan distance or Taxicab metric, more info https://en.wikipedia.org/wiki/Taxicab_geometry

If possible, output should consist solely of a truthy or falsy value Can you clarify what you mean by if possible? Is it mandatory or not? If not mandatory, what other options do we have? Also, do the truthy and falsy values have to be two consistent values, or can they be different for different inputs? For instance one input gives 1 as truthy, another gives 2 as truthy

This question would have been much easier if it had been in metric...

I want this to be a challenge of coding skill, so I'm willing to be lenient with my rules provided that people are reasonable with their code.

I am sorry but I have downvoted this for what others may perceive to be a trivial reason: Code Golf is one of the few things I have left where I can escape how fucked my world has become; I absolutely do not want to come here to be reminded that I can't hug my family and friends.

@Shaggy I feel you (although I upvoted, because it’s a good challenge in general). Also, I don’t like challenges that seem to exploit a popular but unfortunate  situation

@Krish Would you please address my question above? Until then I have to vote to close as unclear. Please let me know when you do so I can retract my close vote

I'll leave it as not mandatory, sorry for the lack of clarity on my previous comment @LuisMendo

@Krish if Truthy/Falsy output is not mandatory, what kinds of output are allowed? We can go with the community consensus, which seems to be "1 consistent value and one non-consistent value".

Lets go the community consensus then. Apologies for the confusion I've caused, I decided when drafting my first question to copy bits of the structure of other high ranking questions.

Thanks for clarifying. You should incorporate that information into the challenge text, so people don’t have to read the comments

Do programs have to support arbitrary grid sizes up to some language limit on array sizes, or is it ok to have an upper bound like 32 or 64 = bits in an integer?  e.g. take input as an array of std::bitset<64>, for a max size of 64x64?  I'm thinking about C++ or assembly that uses integer addition or OR or something to combine 6 bitmaps and check popcnt<=1.  (It's not that easy, some masking would be needed to check horizontally within a bitmap, but it's easier if the grid is at most one full uint64_t wide.)

@PeterCordes I for one am more interested in seeing unique programs than repackaged versions of what others have put online - go for it!

Python 2 with SciPy, 105 101 99 bytes
-1 byte thanks to @vroomfondel !
lambda l:N.all(S.convolve2d(l,N.outer(*[N.r_[:7]-3]*2)**2<9)<2)
import numpy as N,scipy.signal as S

Try it online!
A function that takes in a 2D list, and returns a boolean representing whether social distancing guidelines are met.
Big idea
For each position in the array, there can only be at most 1 person within a 3 unit radius around that position. (If there are 2 people near that position, then they are at most 5 units apart.)
We can use convolution to count how many people are within a 3 unit radius of any point. The kernel specifies all positions at most 3-unit away from the current point:
[[0 0 0 1 0 0 0]
 [0 0 1 1 1 0 0]
 [0 1 1 1 1 1 0]
 [1 1 1 1 1 1 1]
 [0 1 1 1 1 1 0]
 [0 0 1 1 1 0 0]
 [0 0 0 1 0 0 0]]

After convolution, we just need to check if all positions are less than 2.
The following examples show the results of the convolution (0 is replaced with . for visual clarity):
                   ...1......1....
                   ..111....111...
                   .11111..11111..
1......1.          11111111111111.
.........          .11111..11111..
.........          ..111....111...
.........     -->  ...1...1..1....
.........          ......111......
.........          .....11111.....
....1....          ....1111111....
                   .....11111.....
                   ......111......
                   .......1.......

                   ...1......1....
                   ..111....111...
                   .11111.111111..
1......1.          11111122211111.
.........          .111121122211..
....1....          ..1131111332...
.........          ...2121222211..
.......1.          ..111133311111.
.1.......     -->  .111122322211..
....1....          ..1122311332...
.........          ...1132222211..
.......1.          ...12123311211.
...1.....          ..12211222222..
.........          .1112211122211.
1.......1          111112211121111
                   .111111..11111.
                   ..111.....111..
                   ...1.......1...

Code explanation
The only tricky part is to create the kernel. First, we use numpy.outer to find the outer product of 2 arrays:
>> numpy.r_[:7]
[0 1 2 3 4 5 6]

>> numpy.r_[:7] - 3
[-3 -2 -1 0 1 2 3]

>> numpy.outer([-3,-2,-1,0,1,2,3], [-3,-2,-1,0,1,2,3])
[[ 9  6  3  0 -3 -6 -9]
 [ 6  4  2  0 -2 -4 -6]
 [ 3  2  1  0 -1 -2 -3]
 [ 0  0  0  0  0  0  0]
 [-3 -2 -1  0  1  2  3]
 [-6 -4 -2  0  2  4  6]
 [-9 -6 -3  0  3  6  9]]

Then, we only keep the elements whose absolute value is less than 3.
>> numpy.outer(...)**2 < 9

[[0 0 0 1 0 0 0]
 [0 0 1 1 1 0 0]
 [0 1 1 1 1 1 0]
 [1 1 1 1 1 1 1]
 [0 1 1 1 1 1 0]
 [0 0 1 1 1 0 0]
 [0 0 0 1 0 0 0]]

Always an upvote for convolution :-)

Nice! You can save a byte by changing the second argument of the convolve call to N.outer(*[range(-3,4)]*2)**2<9

R, 42 bytes
function(m)all(dist(which(m>0,T),"man")>6)

Try it online!
Pretty self-explanatory - anonymous function that checks whether Manhattan distances between the coordinates of each non-zero entry of the input is greater than 6.

APL (Dyalog Unicode), 18 17 bytes
-1 thanks to Bubbler.
Full program. Input: Expression for Boolean (0/1) matrix via STDIN. Output: 0 or 1 to STDOUT.
(×≡6∘<)+/¨|∘.-⍨⍸⎕

Try it online!
⎕ prompt for matrix
⍸ ɩndices of trues
∘.-⍨ (y,x) distances between all combinations of coordinate pairs
| absolute value
+/¨ sum each (this gives a matrix of Manhattan distances)
(…) apply the following tacit function to that:
 6∘< the matrix mask indicating (0/1) where greater than six
 ×≡ does it match the matrix of signums (0/1)?
In effect, this checks if all non-zero distances are greater than six.

~1∊1 7⍸, -> (×≡6∘<); tacit (×≡6∘<)1⊥¨∘|⍸∘.-⍸ has the same byte count.

Wolfram Language (Mathematica), 59 48 bytes
Saved 11 bytes and removed the imperfections thanks to user202729's great comment!
Min[Tr@Abs[#-#2]&@@@#~Position~1~Subsets~{2}]>5&

Try it online!
Unnamed function taking an array of 0s and 1s as input and returning True or False.

#~Position~1 finds the coordinates of the people in the input array.
~Subsets~{2} collects all unordered pairs of such coordinates.
Tr@Abs[#-#2]&@@@ sums the absolute values of coordinatewise differences inside each such pair.
Min[...]>5& tests whether the differences comprise sufficient social distancing.

In addition to being shorter than the other Mathematica answer, this implementation has the property that it works on inputs of any dimensions (even uneven arrays). Social distancing in spacetime, anyone...?

Can be reduced to 48 bytes with Subsets (and also work when there is no person present).

Norm[#-#2,1] also works in place of Tr@Abs[#-#2], but doesn't seem to work with the ~ syntax and is as long :(

still, nice to know that Norm has that flexibility!

Jelly, 11 bytes
ŒṪŒcạ/€§>6Ạ

A monadic Link accepting a multi-dimensional list which yields an integer: 1 if distancing has been maintained; 0 if not.
Try it online! Or see the test-suite.
How?
ŒṪŒcạ/€§>6Ạ - Link: list
ŒṪ          - multi-dimensional truthy indices
  Œc        - pairs
      €     - for each:
     /      -   reduce by:
    ạ       -     absoulute difference (vectorises)
       §    - sums
        >6  - greater than six? (vectorises)
          Ạ - all truthy?

JavaScript (ES6),  93 84 82  80 bytes
Takes a binary matrix as input and returns a Boolean value.
f=(m,X,Y)=>m.every((r,y)=>r.every((v,x)=>v?1/X?x<X|x-X+y-Y>6:f(m,x,y,r[x]--):1))

Try it online!

Wolfram Language (Mathematica), 63 bytes
2>Max@ListConvolve[Table[Boole[i<j],{i,8},{j,8}],#~ArrayPad~9]&

Try it online!
The list convolution kernel Table[Boole[i<j],{i,8},{j,8}] can be generated as UpperTriangularize@ConstantArray[1,{7, 7}] too (using more built-in), but that's longer.
Unlike most (all?) other solutions posted, this solution only have time complexity O(n) in terms of the input size (with a possibly large constant factor)

Nice use of convolution

Python 3, 99 bytes
Takes as input a list of lists \$ l \$, and outputs True if social distancing is not followed, and False otherwise.
eval(f"lambda l:any(s&q>0<abs(a-c)+abs(b-d)<7{'for %s,%s in enumerate(%s)'*4%(*'aplbqpcrldsr',)})")

Try it online!
Explanation
We can reduce the following code to 99 bytes by using the fact that the expression for a,b in enumerate(c) is used a total of four times, which can be condensed.
Python 3, 111 bytes
lambda l,E=enumerate:any(s&q>0<abs(a-c)+abs(b-d)<7for a,p in E(l)for b,q in E(p)for c,r in E(l)for d,s in E(r))

Try it online!

05AB1E, 20 bytes
˜ƶ0K<Iнg‰2.Æε`αO7@}P

Try it online or verify all test cases.
Explanation:
˜                     # Flatten the (implicit) input-matrix
 ƶ                    # Multiply each value by its 1-based index
  0K                  # Remove all 0s
    <                 # Decrease each by 1 to make it 0-based indexing
     I                # Push the input-matrix again
      нg              # Pop and get the width of the matrix (length of the first row)
        ‰             # Divmod each integer by this row-length to get all coordinates
         2.Æ          # Get all possible pairs of coordinates
            ε         # Map each pair of coordinates to:
             `        #  Pop and push the coordinates separated to the stack
              α       #  Take the absolute differences of both the x and y coordinates
               O      #  Sum those two together
                7@    #  And check whether it's >= 7
                  }P  # After the map: check if all were truthy
                      # (after which the result is output implicitly)

MATL, 18 17 bytes
1Ya&fht1&ZP7<zGz=

Outputs 1 if the input satisfies the distance rule, and 0 otherwise.
Try it online! Or verify all test cases.
Explanation
Consider the following input as an example:
[1 0 0 0 0 0 1 0 0 0;
 0 0 0 0 0 0 0 0 0 0;
 0 0 0 0 0 0 0 0 0 0;
 0 0 0 0 0 0 0 0 0 0;
 0 0 0 1 0 0 0 0 0 1]

      % Implicit input
1Ya   % Padarray with size 1 along the first dimension. This extends the
      % input with two rows of zeros. The purpose if this is to ensure that
      % the modified input will never be a row vector
      % STACK: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
                1, 0, 0, 0, 0, 0, 1, 0, 0, 0;
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0;
                0, 0, 0, 1, 0, 0, 0, 0, 0, 1;
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
&f    % Two-output find: row and column indices of nonzeros. This gives the
      % result as column vectors (it would give row vectors if the input
      % argument were a row vector, but the previou steps ensures that will
      % not happen)
      % STACK: [1; 5; 1; 5], [1; 4; 7; 10]
h     % Concatenate horizontally
      % STACK: [1 1; 5 4; 1 7; 5 10]
t     % Duplicate
      % STACK: [1 1; 5 4; 1 7; 5 10], [1 1; 5 4; 1 7; 5 10]
1&ZP  % Cityblock distance between rows of the two matrices. Gives a matrix
      % with the distances. The diagonal contains 0
      % STACK: [0  7  6 13;
                7  0  7  6;
                6  7  0  7;
               13  6  7  0]
7<    % Less than 7? Element-wise. The diagonal contains 1. An off-diagonal
      % entry is 1 if and only the distance condition is not satisfied for
      % that pair of people
      % STACK: [1 0 1 0;
                0 1 0 1;
                1 0 1 0;
                0 1 0 1]
z     % Number of nonzeros
      % STACK: 8
Gz    % Push input again. Number of nonzeros
      % STACK: 8, 4
=     % Equal?
      % STACK: 0
      % Implicit display

Retina 0.8.2, 87 bytes
M`10{0,5}1|(?<=(.)*)(?=(1)){6}(?<-2>.*\n)+(?>(?<-1>.)*)((?<-2>0)*1|0(?<=1(?<-2>0)*))
^0

Try it online! Takes input as a linefeed-separated character array and outputs 1 or 0 (outputting 0 or 1 would save 3 bytes; outputting 0 or non-0 would save 5 bytes). Explanation:
10{0,5}1|

Are two 1s on the same row fewer than 6 0s apart? Otherwise,
(?<=(.)*)

Count the current column in $#1.
(?=(1)){6}

Store 6 in $#2, plus ensure that we're matching a 1.
(?<-2>.*\n)+

Move down rows, decrementing $#2 each time. (If $#2 runs out, this match fails, so the regex engine has to try fewer rows or starting at a different 1.)
(?>(?<-1>.)*)

Move across to column $#1.
((?<-2>0)*1|0(?<=1(?<-2>0)*))

Try looking either right or left for a 1 that is no more than $#2 0s away, meaning that it is not sufficiently distant.
M`
^0

The above regex looks for insufficiently distant pairs, so check whether none were found to give the desired result.

JavaScript (V8), 126 bytes
e=>(e.map((w,x)=>w.map((t,y)=>t?p.push({x,y}):''),p=[],d=Math.abs),p.every(r=>p.filter(t=>d(r.x-t.x)+d(r.y-t.y)<7).length==1))

Try it online!

Python 3.8 or newer, 137 135 bytes
lambda m:(p:=[(r,c)for r in range(len(m))for c in range(len(m[0]))if m[r][c]])and all(abs(a-c)+abs(b-d)>6for(a,b),(c,d)in zip(p,p[1:]))

Try it online!

perl -E, 157 bytes
@b=map{[/\d/g]}<>;for$x(@a=keys@b){for$z(@a){for$y(@c=keys@{$b[0]}){for$w(@c){$t||=$b[$x][$y]&&$b[$z][$w]&&abs($x-$z)+abs($y-$w)<7&&($x!=$z||$y!=$w)}}}}say$t

Try it online!
Prints a false value (0, or empty string) if all people are at least distance 6 away, and prints 1 if there is at least one pair of people with less distance.


text:
Lead your team to win the wrestlers world championship!
You are the captain of a world-famous wrestling team. An Olympic-grade match is coming up, and you are determined not to let your team down. You also happen to be a competent programmer, so you are going to write a program to help your team win!
You have access to the strength ratings for each of your own team wrestlers, and each of the opponent wrestlers. A wrestler will win their match only when their strength rating is greater than their opponent's strength rating. You have to write a program that will calculate the optimum pairing for each of your own wrestlers against each of the opponent wrestlers, and then output the maximum number of matches that can be won as a result.
Input
Your program will take as input three arguments:

The number of members per team, there will be an equal number of wrestlers on each team. (Optional)
The strength rating of each of your team wrestlers, which is a number between 1 and 10.
The strength rating of each of the opponent wrestlers, which is a number between 1 and 10.

Output
Calculate the optimum pairing for each of your own wrestlers against each of the opponent wrestlers, and then output the maximum number of matches that can be won as a result.
Test cases
Test case 1:
Input:
5
2  4 6 2 6
3 10 6 7 7

Output: 1

Test case 2:
Input:
10
1  9 5 5 1 6 2 8  3  6
6 10 2 8 2 3 5 6 10 10

Output: 6
```

Hello, and welcome to CG&CC! In general when writing a new challenge you want to post it to the Sandbox first, to fix issues before answers can be submitted. The challenge itself seems fine (although I wouldn't be surprised if it's a duplicate), but the input format is stricter than is customary on this site and it would help to have outputs from the given test cases.

Leaving aside for the moment that this very much feels like a dupe (I vaguely remember something with armies instead of wrestlers), this is in desperate need of a couple of worked examples and much looser I/O formats.

Do we have to take the first number?

@Wezl you don't have to if you don't want to. It's there if you want it for help iterating through the list

@Wezl As a side note, input can always be ignored as per this consensus.

Jelly, 5 bytes
Œ!>§Ṁ

Try it online!
The second test case times out on TIO, but I have verified it locally. Takes your lineup as the left argument and theirs as the right.
Œ!       Find every permutation of your lineups' strengths,
  >      compare each matchup for each permutation,
   §     sum your wins for each permutation,
    Ṁ    and return the maximum number of wins.

Python 2, 59 57 bytes
-2 bytes thanks to @dingledooper!
lambda a,b:sum(b.sort()<b<[x]>b.pop(0)for x in sorted(a))

Try it online!
A function that takes 2 lists as arguments, and returns the maximum number of matches that can be won.
Approach
For each opponent (from weakest to strongest), match that opponent with the weakest available member of my team that can win.
For example, let's say the strength of 2 teams (sorted) are as follow:
No.       1  2  3  4  5
Me       [2, 2, 4, 5, 8]
Opponent [3, 6, 7, 7, 9]

The 1st opponent has strength 3, so we need to match that with our 3rd team member.
The 2nd opponent has strength 6, so we match that with our 5th.

We cannot win any more match. So in total we can win at most 2 matches.
Ungolfed code
a,b=map(sorted,input())  # sorted strength of my team and opponent team
s = 0                    # number of matches that can be won
for x in a:              # loop through my team, in order of increasing strength
  if x > b[0]:             # if current member can beat the weakest opponent left
    s += 1                   # then match those two
    b.pop(0)                 # and remove the weakest opponent
                           # (otherwise, current member is useless)
print s

I like the idea with the b<[x]>b.pop(0). I think you can get 57 bytes with a function, though.

@dingledooper Thanks! I was having trouble sorting b in a function, that's really clever.

This is very nice, and - annoyingly - the R ported version is shorter than my own first attempt (so I'm stealing it, with acknowledgement)

C (gcc) -zexecstack, 124 \$\cdots\$ 105 103 bytes
Saved a whopping 2 17 19 21 bytes thanks to ceilingcat!!!
#define q(x)qsort(x,i=n,4,L"\x62b078bǃ");
i;j;f(a,b,n)int*a,*b;{q(a)q(b)for(j=0;i--;j+=*a++>b[j]);i=j;}

Try it online!
How
Sorts the two teams from weakest to strongest. Then goes through our side, starting from weakest, comparing it to the \$j^{\text{th}}\$ member of the opponent's team starting at \$j=0\$, their weakest wrestler. If we are ever stronger than the \$j^{\text{th}}\$ member we increment \$j\$. After we go through all our wrestlers, \$j\$ will be the maximum number we can beat.

+1 for algorithm, now adapted to R with acknowledgement

J, 25 22 20 bytes
0(]+>)/@|.@,I.&(/:~)

Try it online!
-3 bytes thanks to Bubbler
Thanks to Dominic van Essen for spotting a subtle bug (now fixed)

This could be shorter using brute force, but I wanted to see how short I could make an efficient solution.
Our team = right arg, their team = left arg.
Using 2nd test case an example:
6 10 2 8 2 3 5 6 10 10 f 1 9 5 5 1 6 2 8 3 6

&(/:~) Sort both arguments:
2 2 3 5 6 6 8 10 10 10
1 1 2 3 5 5 6  6  8  9

I. Uses Interval Index to determine how many of their players each of our players beats:
0 0 0 2 3 3 4 4 6 7

0...|.@, Prepend a 0 and reverse:
2 3 3 4 4 6 7

(]+>)/ Now reduce from the right as follows: Take the right arg ] (the running sum, seeded at 0), compare the two args using > (returns 1 if left arg is greater than running sum, 0 otherwise), and add the two.
This means the running sum will increment exactly when "the number of opponents the current wrestler can beat" is greater than "opponents already beaten by other teammates".
The final result will be the total number of players our team can beat.

I.~&(/:~) (interval index) gives the same results as 1#.>/&(/:~), and you can remove ~ by swapping args.

Nice observation!  Tyvm.

But what about us: 1 2 3 3 5 5 6 6 7 9, them: 0 0 2 2 3 6 6 6 7 9 ?  Our 1 beats their 0, 2 beats 0, 3 beats 2, 3 beats 2, 5 beats 3, 7 beats 6, and 9 beats 6, so total = 7.

@DominicvanEssen Great spot!  I've fixed the problem which ended up leading to a solution that's 2 bytes shorter.

APL (Dyalog Extended), 16 bytes
(+/⊢≥⍋)0~⍨1⊥<\⍥∧

Try it online!
An almost direct port of Jonah's J answer. But unfortunately, I found that, despite having the same name "interval index", J's I. and APL's ⍸ don't have the identical behavior; J finds the indices before identical elements, but APL does after them.

J: echo 1 3 5 I. 0 1 2 3 4 5 6 gives 0 0 1 1 2 2 3
APL: ⎕←1 3 5 ⍸ 0 1 2 3 4 5 6 gives 0 1 1 2 2 3 3

That makes ⍸ hard to use for this problem, so I had to fall back to outer product (which is used in the previous version of Jonah's answer).
How it works
(+/⊢≥⍋)0~⍨1⊥<\⍥∧  ⍝ Left: opponent strengths, Right: ours
              ⍥∧  ⍝ Ascending sort both args
          1⊥<\    ⍝ Outer product by < and then sum;
                  ⍝ count the opponents who each of ours can win against
       0~⍨  ⍝ Remove zeros
(    ⍋)     ⍝ Grade up; this is identical to ⍳∘≢ here since the arg is sorted
   ⊢≥       ⍝ Check if each number is at least its index
 +/         ⍝ Sum; count ones

But am I screwing-up, or are there cases for which this doesn't work?

@Bubbler, He's correct (my error).  See my update for a simple fix that ended up improving my score.

05AB1E, 5 bytes
Coincidental port of Unrelated String's Jelly answer.
œ€‹Oà

Try it online!
Explanation
œ     All permutations to your team's combination
 €‹   Does your team win at this position?
   O  Sum the resulting lists to get all wins
    à Return the largest item of the list

R, 58 54 bytes
function(a,b){for(i in sort(a))F=F+(i>sort(b)[F+1]);F}

Try it online!
Algorithm based on Noodle9's solution; this could be made shorter than my own original recursive solution 76 bytes or than one based on the elegant algorithm of Surculose Sputum 73 bytes in R

Io, 66 bytes
Algorithm based on Noodle9's solution.
method(x,y,F :=0;x sort map(i,F=F+if(i>y sort at(F+1),1,0))last+1)

Try it online!
Explanation
method(x, y,      // Take 2 arguments.
    F := 0        // Initialize the counter to 0.
    x sort map(i, // For every item in sorted x:
        F = F + if( // Add the counter by:
            i>y sort at(F+1), // if the current item is larger than sorted y at the same position
            1,0)    // converted to an integer
    ) last + 1)     // Add the last item of the map by 1

JavaScript (ES6), 61 bytes
A shorter version inspired by @SurculoseSputum's answer.
a=>b=>(g=a=>a.sort((a,b)=>a-b))(a).map(x=>k+=x>g(b)[k],k=0)|k

Try it online!
That would be 31 bytes if the arrays were already sorted in ascending order:
a=>b=>a.map(x=>k+=x>b[k],k=0)|k

JavaScript (ES6),  85  75 bytes
Takes input as two lists of integers (team, opponents).
a=>b=>a.map(x=>(b[i=b.sort((a,b)=>b-a).findIndex(y=>x>y)]=a,~i&&++k),k=0)|k

Try it online!

Charcoal, 41 bytes
≔Ｉ⪪η η≔Ｉ⪪ζ ζＷΦη›κ⌊ζ«§≔η⌕η⌊ι⁰§≔ζ⌕ζ⌊ζχ»Ｉ№η⁰

Try it online! Link is to verbose version of code. Explanation:
≔Ｉ⪪η η

Input the ratings of your wrestlers.
≔Ｉ⪪ζ ζ

Input the ratings of your opponents.
ＷΦη›κ⌊ζ«

Repeat while at least one of your wrestlers can beat one of your opponents.
§≔η⌕η⌊ι⁰

Set the strength of the weakest such wrestler to 0, so it will no longer be considered.
§≔ζ⌕ζ⌊ζχ

Similarly set the strength of its opponent to 10, so it will also no longer be considered.
»Ｉ№η⁰

Count and output the number of wins.
If the input was sorted, the calculation could be done in 19 bytes. Unfortunately it takes me 30 bytes to sort the input...

Wolfram Language (Mathematica), 48 bytes
Max[t=#2;Tr@Boole@Thread[#>t]&/@Permutations@#]&

Try it online!
Unnamed function taking two arguments as input (first our team, then their team), each as comma-separated lists such as {2,4,6,2,6}. Brute-force check over all Permutations of the input, taking the Max. Mathematica doesn't automatically compare lists elementwise, but Thread[#>t] forces it to; Boole converts Trues and Falses to 0s and 1s, respectively, so that Tr counts the number of wins. Mathematica is bad with currying when it's not programmed into the builtins, so I couldn't see a better way to handle the arguments than t=#2;.

k4, 27 bytes
{{x+y>x}/binr/{x@<x}'(y;x)}

Another port of Jonah's J answer, this time to k4.
If the input can be taken as a single list of two vectors, e.g. (3 10 6 7 7;2 4 6 2 6) (with the opposing team as the first list item, and our team as the second), the code can be simplified to 22 bytes as:
{{x+y>x}/binr/x@'<:'x}

Japt -h, 10 bytes
á Ëí>V xÃn

Try it

Scala, 168 bytes
Golfed version. Attempt this online!
def f(a:Array[Int],b:Array[Int])={var B=b.sorted;var sA=a.sorted;sA.foldLeft(0){(s,x)=>val C=B.dropWhile(_<x);val c=C.nonEmpty&&C(0)==x;if(c){B=B.drop(1);s+1}else s}-1}

Ungolfed version. Attempt this online!
def f(a: Array[Int], b: Array[Int]): Int = {
  var sortedB = b.sorted
  var sortedA = a.sorted
  sortedA.foldLeft(0) { (sum, x) =>
    val removedB = sortedB.dropWhile(_ < x)
    val condition = removedB.nonEmpty && removedB.head == x
    if (condition) {
      sortedB = sortedB.drop(1)
      sum + 1
    } else sum
  } - 1
}

But the scala code fails at the case val input3 = Array(Array(10), Array(3,6,7,5,3,5,6,2,9,1), Array(2,7,0,9,3,6,0,6,2,6)). Any help would be appreciated.

source: Stack Exchange

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

sort: votes


text:
Stepping Through Time
Given a 24 hour time, e.g. 20:48, output the nearest time where each adjacent pair of digits has an absolute difference of 1, e.g. 21:01.
That is, each number in the output must differ from the numbers next to it by 1, and the output must be the closest time, forwards or backwards, for which this is true. Time can be considered to wrap around. For example, 23:55 and 00:05 are only 10 minutes apart.
Input

Input can be in any reasonable form which represents all four digits of a 24 hour time. E.x. a string, "20:48" (colon optional), a list of integers, [2, 0, 4, 8], or a single integer 2048.
Leading zeros are optional for input. Use whatever is most convenient.
You can assume the input will always represent a valid 24 hour time.

Output

You must output four integers which represent a valid 24 hour time. The individual integers can be represented in whatever form is most convenient. E.x. [2, 1, 0, 1] or "2101".
Leading zeros are not optional for output. E.x. you can't output 1:23 instead of 01:23.
You may optionally output a separator between the hours and minutes. This can be a colon, period, space, newline, or some other junk that saves you a byte. Whatever separator you choose, it must be consistent from one output to another.
If there are two equally close times to the input which satisfy the requirements, you may output either.
Note there are only 16 possible outputs: 01:01, 01:21, 01:23, 10:10, 10:12, 12:10, 12:12, 12:32, 12:34, 21:01, 21:21, 21:23, 23:21, 23:23, 23:43, and 23:45.

Test cases

00:10 -> 23:45
01:23 -> 01:23
05:46 -> 01:23
05:47 -> 10:10
12:00 -> 12:10
16:47 -> 12:34
16:48 -> 21:01
20:48 -> 21:01
21:22 -> 21:23 or 21:21

Python 3 reference implementation.
Score
This is code golf, so the shortest program in bytes wins. The standard loopholes are forbidden.

The term "physically" may be a bit misleading ...

@JonathanFrech I agree, but I'm not sure alternative terms are clearer. For example, "spatially" still seems strange. Do you have a term in mind?

Maybe you could say "where each adjacent pair of digits has an absolute difference of 1"

So, there are only 16 different possible outputs? Or are 0 and 9 considered adjacent?

@Abigail, 0 and 9 are not considered adjacent. I didn't count the number of possible outputs, but that sounds about right.

I suggest adding 05:46 -> 01:23, 05:47 -> 10:10, 16:47 -> 12:34, and 16:48 -> 21:01 to the tests since these are the midpoints of the widest intervals.

Jelly, 29 bytes
⁽¬ẊDŻ€Œpḣ⁽¢ẒðIAP€ẹ1ạÞiḢị⁸

A monadic Link accepting a list of four integers which yields a list of four integers.
Try it online! Or see the test-suite.

JavaScript (ES7),  136  132 bytes
Takes a single integer as input and returns a string.
s=>(V=g=(d,t=s,k=0)=>k>V?R:[...S=([1e3]+t).slice(-4)].some(p=c=>(p-(p=c))**2-1)?g(d,t=(t-~d)%2400,k+=t%100<60):(V=k,R=S))()&&g(2398)

Try it online!
How?
The only valid hour prefixes are 01, 10, 12, 21 and 23. It means that any invalid minute count starting with a digit greater than 5 will be rejected by the test on the absolute difference between two consecutive digits.
So there's no need to explicitly handle the wrapping of minutes modulo 60. Instead, we can just make sure that the distance k is not incremented on invalid minutes:
k += t % 100 < 60

JavaScript (Node.js),  148  146 bytes
Takes a single integer as input and returns a string.
This version picks the answer from a hardcoded table.
t=>0x60553BCD48A3CE4F56D818FDC473FC726398E907D3A9n.toString(6).substr([22,85,9,423,462,x=98,x,9,9,413,461,9,x,x,9,9].findIndex(d=>(t-=d+2)<0)*4,4)

Try it online!
How?
Once converted to base-6, the integer 0x60553BCD48A3CE4F56D818FDC473FC726398E907D3A9n is turned into the following string, which holds all possible valid answers:
"23450101012101231010101212101212123212342101212121232321232323432345"

The correct answer is selected according to the interval in which the input time falls:
 answer | input interval
--------+----------------
 "2345" | 00:00 - 00:23
 "0101" | 00:24 - 01:10
 "0121" | 01:11 - 01:21
 "0123" | 01:22 - 05:46
 "1010" | 05:47 - 10:10
 "1012" | 10:11 - 11:10
 "1210" | 11:11 - 12:10
 "1212" | 12:11 - 12:21
 "1232" | 12:22 - 12:32
 "1234" | 12:33 - 16:47
 "2101" | 16:48 - 21:10
 "2121" | 21:11 - 21:21
 "2123" | 21:22 - 22:21
 "2321" | 22:22 - 23:21
 "2323" | 23:22 - 23:32
 "2343" | 23:33 - 23:43
 "2345" | 23:44 - 23:59

The lengths of the intervals in minutes (minus 2) are stored in an array.

Python 2, 136 138 133 126 125 122 151 124 108 106 103 101 bytes
f=lambda h,m,i=0:(h,m)*all(j%11%9==1for j in(h,m/10-h%10,m))or f((h+(m+i)/60)%24,(m+i)%60,~i+2*(i<1))

Try it online!
Input is hour,minute parameters result is (hour,minute) tuple
Using recursion
i moves through [0,-1,+2,-3,+4,...]
the sum of the initial terms therefore moves through [0,-1,1,-2,2,...]
(h,m) are offset by i minutes moving alternately through nearest above and below time not yet checked.
Check for result by considering h, m and h%10*10+m/10, which is low hour digit and top minute digit.
To check two digit number n in form d (d+1) or (d+1) d, observe n%11 is either 1 or 10 in exactly these cases, and checking for 1 or 10 using %9==1. i.e. n%11%9==1
As this two digit test reduces modulo 11, h%10*10+m/10 is equivalently m/10-h%10.
Previous approach:

def f(h,m,i=0):t=m+i;s='%02d'*2%((h+t/60)%24,t%60);return s*all(a+b in'4321012345'for a,b in zip(s,s[1:]))or f(h,m,-i+(i<1))

Try it online!
Input in integer output is 4 character string.
Formats number as string, taking pairs checks against string table, otherwise recurse with alternating offsets (i=0,1,-1,2,-2,...)
Originally:
Offsets n by [0,1,-1,2,-2,...], formats as four digit string, then taking pairs of characters checks they differ by one by looking up as substring in compressed string table.
+2 bytes Fixed by adding '43' to table.
-5 bytes Removed unnecessary +2400, which was to avoid mod of negative number -- Python's % works properly in that case.
-7 bytes string table improved, and by using / instead of // due to Surculose Sputum.
-1 byte reduce range of search.
-3 bytes Surculose Sputum: remove unecessary [] in all() and compress expression i%2*2-1 to i%-2|1.
+29 bytes code was broken, added correction term for wrapping minutes (n%100+i)/60*40
-27 bytes Surculose Sputum: rewritten using recursion
-16 bytes reworked using new approach
-2 bytes remove introduced variable which was false saving.
-3 bytes simplification for middle digits test.
-2 bytes Surculose Sputum: using lambda instead of def

@math junkie thanks

That's much nicer. (I was just removing the +2400, as you commented.)

123 bytes by removing the redundant [] inside all(), and replacing i%2*2-1 with i%-2|1. Nice approach btw, I really like the compressed table idea.

The longest gap is actually 873, between 05:59 and 01:23. So you should use at least range(874).

Nice, but why doesn't 1648 give 2101?

@Jonathan Allan because 2101-1648==453 and 1648-1234==414

But $(21 \times 60 + 1) - (16 \times 60 + 48) = 253$ ...while $(16 \times 60 + 48) - (12 \times 60 + 34) = 322$  i.e. 21:01 is closer to 16:48 than 12:34 is.

That's hilarious, but is it fixable?

Certainly somehow - e.g.. sorting the list by a key function which ranks invalid times to the right. But it'll probably cost a lot of bytes :( If I have a bug I don't know how to fix I delete my post and continue working on it (you'll be able to see the deleted post still and be able to make edits and then undelete when ready).

Also you can discuss with people in the nineteenth-byte chat room (most of whom will be able to view your deleted post)

124 bytes using recursion. Not as good as before but close.

Very clever middle digits test! You can save 2 more bytes by using lambda: f=lambda h,m,i=0:(h,m)*all(j%11%9==1for j in(h,m/10-h%10,m))or f((h+(m+i)/60)%24,(m+i)%60,~i+2*(i<1))

Python 2, 142 bytes
lambda*t:'%02d'*2%max(g(-720,*t))[1:]
g=lambda w,h,m,t=10:w/720*[0]or[(w*w,h,m)]*({h/t-h%t,h%t-m/t,m/t-m%t}<={1,-1})+g(w+1,(h+m/59)%24,-~m%60)

Try it online!
without the strict output:
Python 2, 160 148 144 138 133 bytes
-6 11 bytes thanks to Surculose Sputum!
Input and output is hours, minutes.
lambda*t:max(g(-720,*t))[1:]
g=lambda w,h,m,t=10:w/720*[0]or[(w*w,h,m)]*({h/t-h%t,h%t-m/t,m/t-m%t}<={1,-1})+g(w+1,(h+m/59)%24,-~m%60)

Try it online!

min(map(S,(1,-1))) can be replaced with min(S(1),S(-1))

@SurculoseSputum thanks a lot

Saving 10 into a variable saves another byte.

We can save another 2 bytes by allowing w to wrap around.

@SurculoseSputum thanks again. I was able to cut a few more bytes by changing the comparison of results.

-5 bytes by having w goes from -720 to 720 instead.

Python 2, 159 155 bytes
Heavily inspired by @Arnauld's JavaScript solution. Instead of converting the answer string from hex to base 6, I needed to convert it from hex base 36 to base 10, since Python does not have built-in conversion to an arbitrary base.
-4 bytes thanks to @ovs for the suggestion to convert from base 36
x=input()
j=0
while x>23:x-=[80,4,418,457,93,93,4,4,408,456,4,93,93,4,4,9][j/4]+7;j+=4
print`int("2T9DHQE9BIABWTC7VO76PFJ2QND3LLSQY0ISQTMZCHP5",36)`[j:j+4]

Try it online!
Takes input as an integer representing the time (eg. 2101 for 21:01, or 123 for 01:23). Output is a string in the form hhmm with no delimiter.

int("2T9DHQE9BIABWTC7VO76PFJ2QND3LLSQY0ISQTMZCHP5",36) is 4 bytes shorter than the hexadecimal representation.

Do oct save some bytes or waste or same?

@l4m2 oct(0x4e504105105320820a28828a29a29c4414514534d14d34e34e5) would be 4 bytes longer than the base 36 to base 10 conversion

@l4m2 base 36 and oct combined is still 2 bytes longer: oct(int("1L1MUOJXRSHFY2W81CIGKOUELDFBS0Y9PZCBMPD1",36))[j+1:j+5]

JavaScript (Node.js), 108 bytes
t=>(g=i=>(k=0,s=(new Date(t-i*6e4)+0).slice(16,21),h(1)+h(3)+h(4)-3?g(~i+(i<0)):s))(0,h=l=>(s[k]-s[k=l])**2)

Try it online!

Charcoal, 59 bytes
≔⪪”)⊟ς∧Ｑ@ςE⁶¿ê40ofυ_Y±F⌊M↨ ”⁴υ≔↔⁻↨⁶⁰Ｉ⪪Ｓ²Ｅυ↨⁶⁰Ｉ⪪ι²θ∧⊟υ§υ⌕θ⌊θ

Try it online! Link is to verbose version of code. I/O is as a 4-digit string without colon. Explanation:
≔⪪”)⊟ς∧Ｑ@ςE⁶¿ê40ofυ_Y±F⌊M↨ ”⁴υ

Split a compressed string of all the possible times into substrings of 4 digits. (I tried computing the string but unfortunately that cost at least 6 more bytes.) Additionally include the value 2401 which will map to 0101 for the next day.
≔↔⁻↨⁶⁰Ｉ⪪Ｓ²Ｅυ↨⁶⁰Ｉ⪪ι²θ

Convert the input and the substrings into seconds since midnight and take the absolute difference.
∧⊟υ§υ⌕θ⌊θ

Print the substring with the least absolute difference, but remove the 2401 entry first, which causes the indexing to wrap around to 0101.

05AB1E, 35 bytes
60©Ž5—Ÿ®δвT‰JʒS¥ÄP}D®δβD14(ªI®β.xkè

Both input and output is a pair of [hours, minutes].
Try it online or verify all test cases.
Explanation:
60                 # Push 60
  ©                # Store it in variable `®` (without popping)
   Ž5—             # Push compressed integer 1425
      Ÿ            # Pop both, and push a list in the range [60,1425]
       ®δв         # Convert each integer to a base-60 list/pair
          T‰       # Add leading 0s by taking the divmod-10 on each inner integer,
            J      # and then joining the inner pairs together
ʒ                  # Filter this list by:
 S                 #  Convert it to a flattened list of digits
  ¥Ä               #  Get the absolute difference of each pair of digits
    P              #  And check if all of them are exactly 1
}D                 # After the filter: duplicate the list of remaining pairs
  ®δβ              # Convert each pair from a base-60 pair back to a base-10 integer
     D             # Duplicate that list of integers
      14(ª         # Append a trailing -14
          I        # Push the input-pair
           ®β      # Convert it from a base-60 pair also to a base-10 integer
             .x    # Get the integer in the list closest to this value
               k   # Get the index of this value in the duplicated list
                   # (which will result in -1 for the trailing -14)
                è  # And use that to index into the duplicated list of pairs
                   # (where the -1 will index into the last pair, which is the [23,45])
                   # (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to compress large integer) to understand why Ž5— is 1425.

JavaScript (V8), 155 bytes
(s,o=Math.abs,m=k=>Math.min(o(s-k),o(s+2400-k)))=>[101,121,123,1010,1012,1210,1212,1232,1234,2101,2121,2123,2321,2323,2343,2345].sort((a,b)=>m(a)-m(b))[0]

Try it online!

APL+WIN, 106 bytes
Prompts for time as a vector of integers hh mm:
¯2↑¨'0',¨⍕¨,60 60⊤((|m)=⌊/|m←(¯15,1↓n)-60 60⊥⎕)/n←60 60⊥⍉17 2⍴¯33+⎕av⍳'7M!!!7!5***,,*,,,@,B5!555775777B7M'

Stores 16 possible times as characters in APL+WIN character set (extended ASCII) adjusted by 33 to make printable. Could be removed to save 4 bytes. Converts to seconds, gets closest match and outputs nested character vector of time. Unfortunately I cannot put this up on TIO because my usual route via Dyalog Classic does not work as Dyalog character set appears to be in a different order to APL+WIN. Anyone care to translate?

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


text:
Check if an array (or equivalent) has the same number of odd and even numbers - Code Golf Edition!
Inspired by this code review question, I am curious to see what happens if we turn that into a code-golf challenge!
The description is easy, the input is an array or any similar data structure with only unsigned integers, the output is a boolean if the number of odd numbers is equal to the number of even numbers inside (true or false doesn't matter, as long as the opposite is used in case the number doesn't match)
Here are some examples with true as output for matching (thanks to the original OP)
[5, 1, 0, 2]      ->  true
[5, 1, 0, 2, 11]  ->  false
[]                ->  true

Usual code-golf rules, shortest code wins.

Challenges should be self contained. References to external resources are welcome, but you should not rely on them. Please post some test cases here.

@manatwork true, i was going to do that but I forgot, thanks for noticing that.

May we reverse the output so that a falsy value means they are equal and a truthy value means they are not (as long as they are unique and consistent values of course)?

@ElPedro I could say no if I wanted to be strict but, why not, maybe something interesting comes out of it. I'll edit the question.

Ha, just realised that my idea is not going to work anyway but the suggestion may help someone else. One further question - if a language does not support arithmetic operations on an empty list can we ignore the empty list example (or just throw an error)?

@ElPedro sorry not empty lists exemptions, you should always consider edge cases to avoid bugs :P

Fair enough :-)

I'd like to write an answer in COW. But without knowing the size of the array it would be impossible. Can I add -1 at the end of the input array?

@DomenicoModica A similar assumption has been made for the C solution. Since the input is only unsigned numbers, using a sentinel of -1 for end I think is fair. Go ahead ;)

Does it need to be a Boolean or falsy/truthy is fine as usual?

@LucaCiti Fine as usual

Haskell, 20 bytes
(==0).sum.map((-1)^)

Try it online!

Python 2, 33 bytes
lambda l:sum(n%-2|1for n in l)==0

Try it online!
n%-2|1 is a shorter way to do(-1)**n. It works like this:
   n  n%-2  n%-2|1
------------------
even     0       1
 odd    -1      -1

36 bytes
lambda l:sum(map((-1).__pow__,l))==0

Try it online!

Also works in Python 3

Jelly, 4 bytes
Thanks to Nick Kennedy for fixing a bug after three years!
Ḃo-S

A monadic Link that accepts a list of integers and yields zero (falsey) if the odd and even counts are equal or a non-zero number (truthy) otherwise.
Try it online!
How?
Ḃo-S - Link: list of integers              e.g. [ 1, 2, 3, 4, 6]
Ḃ    - least-significant bit (vectorises)       [ 1, 0, 1, 0, 0]
  -  - -1
 o   - logical OR                               [ 1,-1, 1,-1,-1]
   S - sum                                      -1

Alternatively, ịØ+S, does the same thing using modular indexing.

@MarcusMangelsdorf - the 5 is the 1-based index of the rightmost zero.

@NickKennedy Oops, schoolboy error; shocking that neither I nor others noticed at the time. Thanks for the fix :)

-2 bytes, BIG Thanks to Arnauld
JavaScript (V8), 31 bytes
s=>s.map(e=>d+=e&1||-1,d=0)&&!d

Try it online!

Based on your answer s=>s.map(n=>c+=1-n%2*2,c=0)&&!c - 31 bytes

Here is my version (Thanks to @ElPedro and to everyone in the comments for the corrections):
Python 3, 37 bytes
lambda x:sum(i%2for i in x)==len(x)/2

Try it online!

37 if you use a lambda and lose the unneeded space between %2 and for

The space in front of for keyword is not necessary.

34, if you port the most upvoted answer at Code Review.

34/31 if you use map instead of a comprehension: sum(map(lambda i:i%2,x))==len(x)/2 or  sum(map(lambda i:i%2*2-1,x))==0

I don't think the first answer is even valid, because it relies on a hardcoded list, and takes no input.

@match Save 1 byte in the first solution by replacing lambda i:i%2 with 2 .__rmod__.

Your TIO link has an "input" section which the program ignores.  I'd suggest removing it to leave only the footer which makes the call.  I wondered if len/2 would fail for odd lengths, but Python 3 / can produce a floating-point result so 2 == 2.5 is false if you tack on another odd number.  Also remove the invalid 48-byte version; those 48 bytes include the input for this code fragment that isn't a lambda or function.

@PeterCordes Thanks, that might be a simple solution for now. Yeah, luckily for Python 3 division always result in floating points, which will make the equality always false, which is the expected result after all.

Uh, now you only have a code fragment, not a valid program or function/lambda.  Notice how all the other Python answers use lambda.

@PeterCordes sorry, i'm a noob for this competition. Is there a meta post with the general rules? so that I'll read them and adapt (and add them to the questions)

Default for Code Golf: Program, Function or Snippet?.  Snippets aren't allowed unless explicitly specified in the question.  (Don't change the question; requiring self-contained functions or lambdas (or whole programs) works better for code golf and is what existing answers are written for.)

@PeterCordes Thanks, completely misses that. There should be a template or something available for challenges so that it's easy to get all rules on hand. I'll edit the answer accordingly (which is a pity since print is slightly shorter than lambda)

perl -alp, 20 19 bytes
$_=@F-2*grep$_%2,@F

Try it online!
Just checks whether the size of the input is twice the number of odd integers. Accepts a list of space separated integers on STDIN. Prints 0 if the number of even and odd numbers are equal, something else otherwise.

Ruby, 23 bytes
->x{x.sum{|n|~0**n}==0}

Try it online!
Special thanks to Manatwork, Dingus and to histocrat for finding the shortest solution, all credit to them.

You know the other method is shorter in Ruby too, right? Try it online!

@manatwork Even shorter.

Yet shorter

Thank you all, I tried to understand all your solutions, very clever.
Didn't know that n%-2 is equivalent to -(n%2)
@histocrat would you mind explaining how the binary one's complement operator in ruby works? I don't understand how 05 = 0 is different from 04 = 0.
Thanks!

@ArmandFardeau, sure. ~ in Ruby is a two's complement negation, so ~0 is equal to -1. -1 to the power of an even number is one, but to the power of an odd number is negative one. The reason we can't just do the more readable -1**n is that ** has a higher precedence than -, so it ends up being parsed like -(1**n)which is always negative one.

K (Kona), 7 6 bytes
-1 byte thanks to coltim
~+/-1^

Try it online!
J, 9 bytes
0=1#._1^]

Try it online!
Ports of xnor's Haskell solution - please upvote him!

You can trim a byte from Kona version by replacing 0= with ~

@coltim Yes, indeed. Thank you!

Wolfram Language (Mathematica), 14 bytes
Tr[(-1)^#]==0&

Try it online!

Perfect! ... :)

MathGolf, 4 bytes
Port of @xnor's Haskell answer. In MathGolf, summing an empty list yields 0.
b▬Σ┌

Try it online!
Explanation
b    Constant -1
 ▬   -1 ** input list (vectorizes)
  Σ  Sum the resulting list
   ┌ Convert to inverted boolean

dc, 25 24 23 bytes
?0[r_1r^+z1<F]sFz1<Fd/p

Try it online!
Or verify the test examples.

Input on stdin: a line of space-separated integers.
Output on stdout: 0 for truthy, and 1 for falsey (dc doesn't have standard truthy/falsey values).

Python 3, 30 bytes
lambda x:sum(i%2-.5for i in x)

Try it online!

x86 32-bit machine code, 13 bytes
Input: uint32_t *esi, size_t ecx
returns: EDX = len - 2*even = 0 for balanced, non-zero for unbalanced.
This conveniently works even for len=0 = balanced.  As part of this asm custom calling convention / ABI, my boolean data type is 0 / non-zero, rather than the 0 / 1 that C ABIs use.
This avoids needing to actually compare, just decrement twice inside the loop, starting with the list length.
     1                         boe:
     2 00000000 89CA               mov    edx, ecx           ; balance = len
     3 00000002 E309               jecxz  .end
     4                         .loop:                        ; do {
     5 00000004 AD                 lodsd                       ; eax = *p++
     6 00000005 A801               test   al, 1
     7 00000007 7502               jnz   .odd
     8 00000009 4A                 dec    edx
     9 0000000A 4A                 dec    edx                 ; more compact than sub edx,2 in 32-bit code
    10                         .odd:
    11 0000000B E2F7               loop   .loop              ; }while(--ecx);
    12                         .end:
    13                         ;    xchg   eax, edx          ; custom calling convention: return in EDX instead of spending a byte on xchg
    14 0000000D C3                 ret

Try it online! (with a _start test case that exits with the return value as exit status)
An alternate version that calculates in EAX to return in the standard calling convention's register is 14 bytes.  It uses test byte [edi], 1 (1 byte longer than test al,1) and increments the pointer with scasd (without caring about the FLAGS result of the eax - [edi] it also does).  See the TIO link.
Uncommenting the xchg eax, edx at the bottom of the 13-byte version would do the same thing, and that version's loop is more efficient.

For 8-bit integer input, use lodsb instead.  Unfortunately, we can't use and al, 1 / add dl, al or similar (without branching).  That would only work for array sizes up to 255.  and eax,1 is 3 bytes.
Also, masking and adding only does one increment.  lea edx, [edx + eax*2] could work but that's also 3 bytes.  Branching on the low bit with test/jnz seems to be best for size, although it sucks for performance with branch mispredicts.
Of course if we wanted to go fast, we'd load 16 bytes at once with movdqa, isolate the low bits with pand, and sum with paddd.  Then hsum at the end.  Or hsum with psadbw against a zeroed register, then paddq.  SIMD is of course especially good for 8-bit elements, 16 per vector instead of 4, with an outer loop to avoid overflowing 8-bit counters.  e.g. this AVX2 SO answer.
Something like this could maybe be smallish code-size if we limited it to a fixed-size 16-byte input array, or maybe 8-byte in MMX registers.  Unfortunately we rarely get to play with SIMD in code golf because the instructions are larger and inputs can be odd lengths requiring cleanup loops.

[Excel], 28 bytes
Paste this into a cell outside of column A, the array goes in column A.
=0=SUM(IF((A:A<>""),-1^A:A))

An example:

Got some extra parens around the comparison, I think?

Java (JDK), 28 bytes
a->a.map(n->-n%2|1).sum()==0

Try it online!

Nice job golfing it in Java!

Nice solution! I was wondering, is it really allowed in Java CodeGolf to have an IntStream as the input type? I was reluctant to use it, but i would really like to :)

@Fhuvi "the input is an array or any similar data structure", also "Usual code-golf rules", so yes...

APL (Dyalog Extended), 7 bytes
Port of xnor's Haskell solution. Prompts for the input; -2 thanks to @Graham.
-1 byte thanks to @Adám by switching the language.
=+/¯1*⎕

Try it online!

Can you save 2 bytes by dropping ()∘ and replacing it by simple ⎕ input

You can save another byte by switching to Extended Dyalog APL (=+/¯1*⎕) or dzaima/APL (0=1⊥¯1*).

Burlesque, 17 14 bytes
ps{2.%}pt)L[sm

Try it online!
Saved 3 bytes using shorthand map
Explanation:
ps                # Parse input as a block
  {2.%}pt         # Partition block based on modulo 2
         )L[      # Map blocks to their length
            sm    # Check lengths are the same

Befunge-98 (PyFunge), 13 12 bytes
-1 byte thanks to @Jo King!
#.&2%2*1-+#@

Try it online!
This uses the same logic (&2%2*1-+) as @Abigail's answer, but has a different control flow structure. Befunge-98 adds extra "error handling" functionality to the  & and ~ input instructions: when EOF is reached, they reflect the instruction pointer. When this happens, the program can execute a different section of code without the need for an explicit conditional.
#.&2%2*1-+#@

               (Implicit: the counter, the top of the (empty) stack, starts at 0)
               (Implicit in program structure: begin loop)

#              Skip the next instruction
 .             (skipped)
  &            Get integer from STDIN
   2%          Take the integer modulo 2
     2*        Multiply that by 2 (results in 2 if the number was odd and 0 if even)
       1-      Subtract 1 (results in 1 if the number was odd and -1 if even)
         +     Add that to the counter
          #    Skip the next instruction
           @   (skipped)
               Repeat

When the input runs out:
  &            Catch the EOF and reverse direction
 .             Output the counter (0 if odds and evens are matched, nonzero otherwise) as an integer
#              Skip the next instruction (a space)
           @   End the program

MATL, 6 5 bytes
-1 bytes thanks to @LuisMendo
oEqs~

Try it online!
Explanation
oEqs~
o      % Replace each elements with its parity (i.e. mod 2)
 E     % Multiply all element by 2
  q    % Decrement all elements by 1
   s   % Sum the array
    ~  % Boolean not the sum

sed -E, 78 80 bytes
+7 to account for 0's and empty lists, -5 from golfing
Tried to have some fun:) Input is spaced separated unary numbers.
Ex: echo "!!! !! !!!!" | sed -Ef main.sed (if the code is saved to main.sed)
s/_/@/g
s/(!!)+/@/g
s/@*!/!/g
s/ //g
:l
s/(!@|@!)//g
tl
s/!+/true/g
s/^$/false/g

Try it online!

Welcome to Code Golf, and nice first answer! Be sure to check out our Tips for golfing in sed page for ways you can golf your program

K (ngn/k), 6 9 bytes
+3 bytes from fixing code per @Dominic van Essen's comment
~+/1 1'2!

Try it online!

2! mod the (implicit) input by two
1 1' convert 0's to -1's, leave 1s unchanged
~+/ not the sum of the above

I don't think this can work for inputs with an odd-number of elements, but an even number of odd numbers, like [5 1 0 2 4]...

Good catch - revised the approach to fix that behavior. Thanks!

Uiua, 8 bytes
=0/+ⁿ∶¯1

Try it!
=0/+ⁿ∶¯1
    ⁿ∶¯1  # raise -1 to input
  /+      # sum
=0        # is it equal to zero?

Or 1 for falsy if there's more evens.

@UnrelatedString Oops, fixed for +1.

Alternative 8: =∩/+¬.◿2

05AB1E, 6 4 bytes
ÉD¢Ë

Try it online!
Explanation
É    Is the number odd?
 D   Duplicate
  ¢  Count the occurances of the bits in the original copy
   Ë Are all items in the list equal?

C (gcc), 45 44 43 bytes
Saved a byte thanks to ceilingcat!!!
Saved a byte thanks to Olivier Grégoire!!!
b;f(int*a){for(b=0;~*a;b+=-*a++%2|1);b=!b;}

Try it online!
Input:
\$-1\$ terminated int array.
Output
C boolean values: \$1\$ if number of odd are equal to the number of even numbers, \$0\$ otherwise.
How
Initialise a counter b to \$0\$. Then go through the elements in the array adding \$1\$ to b for every odd number and \$-1\$ to b for every even number. Return the boolean result of testing b equal to \$0\$.

b+=-*a++%2|1 to save a byte

@OlivierGrégoire Nice one - thanks! :-)

Factor, 52 bytes
: f ( s -- ? ) [ odd? ] partition [ length ] bi@ = ;

Try it online!

Pyth, 6 bytes
!sm^_1

Try it online!
Explanation
!sm^_1
  m    : map
   ^_1 : -1 power value
       : over implicit input
 s     : sum it
!      : logical negate the sum (i.e. 0 -> True, -1 -> False, 10 -> False)

R, 18 17 bytes
!sum((-1)^scan())

Try it online!
Edit: -1 byte thanks to Bart-Jan van Rossum

You can save 1 byte  using !sum((-1)^scan())

Thankyou!  That is clever, and I'm jealous that I didn't think of it myself.

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

Try it online! (Check the ! box to enter input automatically.)
Takes input as code points. Prints a null byte if there are equal number of odds and evens. Otherwise, prints a non-null byte.
Memory layout:
a b 0 n 0

where a is the current number of odds, b is the current number of evens, and n is the current element in the array.
Explanation:
+>+>>        set a and b to 1, and pointer to n
,[           for each element n in the array
  [-[->]<]     if n is even, pointer stops at n, else, pointer stops at left of n
                 in both case, n is set to 0
                 this requires the cells left and right of n to be 0
  <<+          increment a or b appropriately
  [>]>,        pointer back to n, read new n
]            stop if n = 0 (end of array)
<<[-<->]<.   find b - a, and print that value

I liked your answer :D

Keg, 13 10 bytes
÷⑷0;$Ë⑸⅀0=

Try it online!
Transpiled Code
item_split(stack)
keg_map(stack, '0;$Ë')
summate(stack)
integer(stack, 0)
comparative(stack, '=')

0;$Ë turns into:
integer(stack, 0)
decrement(stack)
swap(stack)
exponate(stack)

Brachylog, 6 bytes
%₂ᵍlᵐ=

Try it online!
How it works
%₂ᵍlᵐ=
  ᵍ     group input based on result of …
%₂        mod 2
   lᵐ   map length over all groups
     =  are the lengths equal?

Brainetry, 342 bytes
Golfed version:
a b c d
a b
a b c d
a bb
a b
a b c d e f
a b c d e f g h
a b c d e f g h
a b c d e
a b c d e f g h
a b c d e
a b
a b c d e f g h i
a b c
a b c d e f g h i
a b c
a b c
a b c d
a b c d e f g h
a b
a b c d e f g h i
a b
a b c d e f
a b c d e f g h i
a b c
a b c
a b c d e f g h
a b c d e
a b c
a b c d e
a b
a b c d e f g h i
a b c
a b c d e f g

To make our lives easier we use the --numeric-io flag, so that we can take input and give output as integers, but we don't really need to and the answer works without it. Read the program below for due credit.
The golfed version was adapted from the program found below. To try this online you can

head over to this replit link, copy&paste the code into the btry/replit.btry file and hit the green "Run" button (takes input as ASCII characters (converts them to codepoints) and outputs ASCII characters, use CTRL-D in a newline to terminate input, doesn't really work well for this challenge.);
clone the github repo and from your terminal run ./brainetry btry/ppcg/evens_and_odds.btry --numeric-io (give one integer per line, use CTRL-Z or CTRL-D in an empty line to stop giving input).

"Check if an array
(or equivalent)
has the same number
of odd
and even
numbers - Code Golf Edition !"
That is the title of the codegolf.stackexchange.com challenge
that this brainetry program solves. Once more, with
no shame at all ,
I am piggy backing on someone else's answer.
This time, Surculose Sputum's answer.
Oh boy!
You can check the original answer over here: https://codegolf.stackexchange.com/a/205621/75323
Go upvote that!
This is a very literal port of that answer.
I am pretty
sure I could
have used brainetry's builtins
to make this easier, like » or ≥,
except that
would mean I would have to think... ugh... nope!
For now
I will stick to the low
hanging fruit just to show that brainetry is out.
If this is
the first time
you find a brainetry program, welcome! By now
you probably understood you are
allowed to write
pretty much anything as source.
(source code)
You only have to write lines of correct size
and with the
correct line modifiers. (That's a recent addition.)

This is amazing, +1 for the poem

Arturo, 25 23 bytes
$=>[0=∑map&=>[^0-1&]]

Try it

Thunno, \$ 4 \log_{256}(96) \approx 3.29 \$ bytes
1n@S

Attempt This Online!
Outputs 0 (which is falsy in Thunno) for true and something else (which is truthy in Thunno) for false (meta consensus).
Thunno, \$ 6 \log_{256}(96) \approx \$ 4.94 bytes
1n@S0=

Attempt This Online!
Outputs True for true and False for false.
Explanation
Port of xnor's Haskell answer.
1n@S0=  # Implicit input
1n      # Push -1
  @     # Get -1 ** each element of the input
   S    # The sum of the resulting list
    0=  # is equal to 0?
        # Implicit output

JavaScript (Node.js), 29 bytes
a=>a.map(x=>i+=x%2-.5,i=0)|!i

Try it online!
Combined some js and py solution
If input.length==1 then a.map returns 0.5 or -0.5, treated as 0 on bool operation
+1B if returning bool required
a=>a.map(x=>i+=x%2-.5,i=0)&&!i

Try it online!

I thought how to optimize 1-x%2*2 and you did it! But you cheated a little :) You need to return boolean not a number

@EzioMercer Comes from here

jq, 24 characters
map(.%2)|add+0==length/2

Just a write of the question owner's Python solution.
(Grr! 2 characters wasted because []|add results null.)
Sample run:
bash-5.0$ jq 'map(.%2)|add+0==length/2' <<< '[5, 1, 0, 2]'
true

Try it online! / Try all test cases online!
jq, 21 characters
map(.%2*2-1)|add+0==0

The other most efficient solution from Code Review.
Sample run:
bash-5.0$ jq 'map(.%2*2-1)|add+0==0' <<< '[5, 1, 0, 2]'
true

Try it online! / Try all test cases online!

Does jq not have a logical negation operator that can return true for both null and 0, so that you don't have to use +0==0?

@Neil If jq has one, I'd be able to golf my Erlang solution.

@Neil, in jq the only negation is the not filter, but as jq is quite strictly typed, all numbers are truthy: jq -c 'map(not)' <<< '[null,0]' results [true,false]. Even that + is working as an exception as the other arithmetic operators throw error on null operand.

Husk, 6 bytes
Why does need so many bytes... help!
EmLk%2

Try it online!

Julia 18 bytes
Try it!
l->sum((-1).^l)==0

Octave, 19 bytes
@(x)(~sum((-1).^x))

Try it online!

I don't think you need the () around the ~sum() statement.

Golfscript, 18 bytes
~.{2%},\{2%!},,\,=

Try it online!

Japt -!xm, 3 bytes
JpU

Try it
Explanation
The Flags:

! Outputs the logical NOT of the value returned by the program
x Reduces output of program on plus
m Runs the program on each element in the first input, outputting an array of the results.

J    // The number -1
 p   // power
  U  // Input

Japt, 7 6 bytes
!Ux!pJ

Try it
Same thing as above but without flags
Explanation
   !pJ  // Function that does -1 ** arg
 Ux     // Map input on function then sum
!       // Logical not

Raku, 15 bytes
{!sum -1 X**$_}

Try it online!
The usual not of the sum of negative one to the power of each element in the input.

Factor + math.unicode, 22 bytes
[ -1 swap n^v Σ 0 = ]

Try it online!
Explanation:

-1 push -1 to the data stack (e.g.) { 5 1 0 2 } -1
swap swap top two objects on the data stack -1 { 5 1 0 2 }
n^v vectorized exponentiation { -1 -1 1 1 }
Σ sum a sequence 0
0 push 0 to the data stack 0 0
= check top two objects on the data stack for equality t

Vyxal, 5 bytes
∷Ċvt≈

Try it Online!

Go, 62 bytes
func(L[]int)bool{n:=0
for _,i:=range L{n+=-i%2|1}
return n==0}

Attempt This Online!

QBasic, 38 bytes
1s=s+(-1)^n
INPUT n
IF n>=0GOTO 1
?s=1

Enter the numbers one at a time with -1 as a sentinel value at the end. The program then outputs either -1 (true, same number of evens and odds) or 0 (false, different number of evens and odds).
Try it at Archive.org!
Explanation
The same "sum of \$-1\$ to the power of each number" approach as a lot of answers, with a twist. The straightforward approach is to write a loop like this:

Input a number
If it's -1, output the sum and quit
Else, add \$\pm1\$ to the sum accordingly and loop

But it's golfier if we can write a simple loop with the condition at the end (1 ... IF n >= 0 GOTO 1) rather than breaking out of the middle. So our actual loop looks like this:

Add \$\pm1\$ to the sum
Input a number
If it's nonnegative, loop
Else, output the sum and quit

Since QBasic initializes numeric variables to 0, the first s = s + (-1) ^ n before any n has been input adds 1 to s. Thus, a balanced array at the end of the loop is indicated by s being 1, not 0.

Pyt, 6 bytes
1∧2*⁻Ʃ

Try it online!
Outputs 0 (which is falsy in Pyt) for True and something else (which is truthy) for False
1∧        implicit print; bitwise-AND with 1 (equivalent to mod 2)
  2*⁻     double and decrement each element
     Ʃ    get sum; implicit print

Zsh, 31 bytes
for i;((i%2?j++:k++));<<<$[j-k]

Try it online!
Outputs 0 (truthy) if odds = evens, non-zero otherwise.

Pip, 21 bytes
b:0Wa{%POa?++i++b}i=b

Try It Online!

TI-Basic, 10 bytes
dim(Ans)=4sum(fPart(Ans/2

Takes input in Ans.

Thunno 2 S!, 2 bytes
u@

Attempt This Online!
Thunno 2, 4 bytes
ñEḷạ

Attempt This Online!
Explanation
u@  # Implicit input
u   # Push -1
 @  # Exponentiation
    # Check if the sum is 0
    # Implicit output

ñEḷạ  # Implicit input
ñ     # Group by:
 E    #  Is even?
  ḷ   # Length of each
   ạ  # Equal?
      # Implicit output

Thunno 2 S!, 2 bytes: u@

@noodleman nice one! Thanks!

Desmos, 23 bytes
f(l)=0^{(-1)^l.total^2}

Try It On Desmos!
Try It On Desmos! - Prettified

Vyxal, 15 bitsv2, 1.875 bytes
Ǎ∑

Try it Online!
Uses inverted booleans (0 for truthy, any other value for falsey)
Explained
Ǎ∑
 ∑  # Sum of
Ǎ   # -1 to the power of each number in the input

GolfScript, 13 bytes
~.,2/\{2%},,=

Try it online!
~.,2/\{2%},,=
~              # Evaluate the input string.
 .             # Duplicate the list on the stack.
  ,            # Push the length of the list.
   2/          # Divide it by 2.
     \         # Swap so the original list is on top.
      {  },    # Filter, only keeping items that
       2%      # aren’t divisible by 2.
           ,   # The length of the filtered list.
            =  # Is this equal to the length of the original divided by 2?

Created with the help of Luminespire.

SQLite, 28 bytes
SELECT SUM(N%2*2-1)=0 FROM T

Inspired by this comment.
Try it online!

Zpr'(h, 151 bytes
f|>\

(g ° (section p <$> @))
(g .l)|>((2 * (length (filter (section 0 == @) l))) == (length l))
(p ())|>0
(p (S ()))|>1
(p (S (S .n)))|>(p n)
<|prelude.zpr

test-cases |> ('\
        (' 5 (' 1 (' 0 (' 2 ())))) ('\
        (' 5 (' 1 (' 0 (' 2 (' 11 ()))))) ('\
        (' 2 (' 16 (' 3 (' 2 (' 11 (' 19 ())))))) ('\
        (' 2 (' 16 (' 3 (' 4 (' 2 (' 11 (' 19 ()))))))) ('\
        () \
    ())))))
main |> (zip test-cases (map f test-cases))

% ./Zprh stdlib/golf.zpr --de-peano
(' ((' 5 (' 1 (' 0 (' 2 0)))) , true) (' ((' 5 (' 1 (' 0 (' 2 (' 11 0))))) , false) (' ((' 2 (' 16 (' 3 (' 2 (' 11 (' 19 0)))))) , true) (' ((' 2 (' 16 (' 3 (' 4 (' 2 (' 11 (' 19 0))))))) , false) (' (0 , true) 0)))))

APL+WIN, 15 bytes
Prompts for input of array. Can be anything from scalar, vector or multi dimensional array. TIO gives examples up to a 4 dimensional array:
(+/~n)=+/n←2|,⎕

Try it online! Coutesy of Dyalog Classic

Erlang (escript), 40 bytes
Port of the Python answer on Code Review.
f(I)->lists:sum([X rem 2*2-1||X<-I])==0.

Try it online!
Explanation
f(I)->    % Takes an input argument
||X<-I]   % For every inputted item:
[X rem 2*2-1 % Convert X % 2 into 1's and -1's, respectively
lists:sum()  % Sum the list
==0.          % Is it 0?

Befunge-93, 27 26 bytes
0v   @.$<
+>&:1+!#^_2%2*1-

Try it online!
Prints 0 if the number of odd and even numbers are equal, something else if they aren't. Keeps track of the difference between the number of even and odd numbers seen, adding 1 for an odd number, and -1 for an even number. Prints out this difference.
Edit: Moved the + to the left, saving a byte.

The initial stack in Befunge is implicitly a bunch of 0s, so I don't think the first 0 is necessary in the code. Removing it and shifting everything else to the left should get it down to 25 bytes.

Charcoal, 5 bytes
¬ΣＸ±¹

Try it online! Port of @xnor's Haskell answer. Corresponds to the verbose code Print(Not(Sum(Power(Negate(1), Input())))); except that the input is implicit. Works even for zero-length arrays whose sum is Null rather than 0. Note: Zero-length input arrays seem to confuse Charcoal, so input that case as [[],[]].

Retina 0.8.2, 49 bytes
\d+
$*
+`(^|(,))(11)*(,1|1,)(11)*($|(\2)|,)
$7
^$

Try it online! Link includes test cases. Explanation:
\d+
$*

Convert to unary.
(^|(,))(11)*(,1|1,)(11)*($|(\2)|,)
$7

Match an even number of characters that includes a single , and is delimited on either side by either the end of the string or a ,, thus corresponding to a pair of numbers of opposite parity. Remove both numbers and at most one adjacent ,.
+`

Continue to remove pairs of numbers until all remaining numbers have the same parity.
^$

Check that there are no numbers left.

R, 28 bytes
!sd(table(c(0,1,scan())%%2))

Try it online!
table gets the counts of the unique values in the array. By appending c(0,1) to the array, we take care of the empty case. The standard deviation is equal to zero if and only if all the values from table() are equal, so we take the logical negation of that to get the result.
Alternately:
R, 28 bytes
!any(diff(table(scan()%%2)))

Try it online!

Icon, 52 bytes
procedure f(a)
(s:=0)+:=-1^!a&\z
return(s=0&1)|0
end

Try it online!

Racket, 44 bytes
(λ(a)(=(apply +(map(λ(x)(expt -1 x))a))0))

Try it online!

Jelly, 4 bytes
-*S¬

Try it online!
Could be 3 bytes under "one consistent value, one non-consistent value" rules, with -*S outputting 0 for true and anything else for false.
   ¬    Whether or not 0 equals
  S     the sum of
-       -1
 *      to the power of every element of the input (implicitly vectorized).

Edit: shortened both by one byte by changing n%2*-2+1 to n%2*2-1
JavaScript (Node.js), 28 bytes with -p flag
.map((i=0,n=>i+=n%2*2-1));!i

Try it online!
Link leads to a TIO instance with console.log(!i) because I can't find out how to use the Node.js -p flag on TIO.
Less "cheating" answer:
JavaScript (Node.js), 32 bytes
a=>(a.map(x=>i+=x%2*2-1),!i);i=0

Try it online!
This link also leads to a snippet with console.log because I still can't figure out how to use the -p flag, but this one's a function.

Clojure (60 bytes)
(defn q[c](reduce = (map #(count(filter % c))[odd? even?])))

Ungolfed:
(defn eq-odd-even [c]
  (reduce = (map #(count (filter % c)) [odd? even?])))

Try it online!

Scala, 20 18 bytes
_.map(_%2*2-1).sum

Try it online!
Outputs 0 if there as many odd numbers as even numbers, a negative number if there are more even numbers, and a positive number if there are more odd numbers.
Also 18 bytes:
_.:\(0)(_%2*2-1+_)

Try it online!

Previous solution, 33 bytes
a=>a.count(_%2>0)==a.count(_%2<1)

Pretty straightforward solution. Just checks if the number of odd numbers equals the number of even numbers.
Try it online!

Rust, 44 bytes
|a|a.iter().map(|n|(n&1)*2-1).sum::<i8>()==0

Try it online
Argument type is a: Vec<i8>.
.iter() and ::<i8> add 13 bytes to the solution which  hurts the score quite a bit, but the compiler can't infer the <i8> unfortunately. If this closure accepted an iterator instead of a Vec<i8> (for example std::slice::IterMut<'static, i8>), the .iter() could be removed, but that seems a bit cheaty.

From what I read, this is not a valid Rust suggestion since the type can never be inferred. See https://codegolf.meta.stackexchange.com/a/25164/109946.

@leo848 Maybe I'm misunderstanding how meta works, but doesn't this say that types can be inferred? https://codegolf.meta.stackexchange.com/questions/11223/untyped-functions-in-static-languages The post you linked was closed, referencing this post instead, and anyway was posted well after my answer was posted.

In that case, you do seem to be right. I thought that as this code can never compile as-is and requires explicit type annotations, it might not be valid.

Prolog (SWI), 84 72 bytes
Saved 12 bytes thanks to this tip that user41805 suggested!
[]*A*A.
[H|T]*E*O:-M is mod(H,2),F is E+1-M,P is O+M,T*F*P.
f(X):-X*0*0.

Try it online!
g accepts a list, the number of even elements found so far, and the number of odd elements found so far. The base case is an empty list where the second and third parameters are the same. The second case calls g on the tail T, and increments E (number of even elements) or O (number of odd elements) depending on the head of the list, H. f is just for convenience, and starts g off with 0 elements of both parities.

You have to put queries in the input like so, https://tio.run/##NYuxDkAwGIR3T2H8G1dRicVmIJaGwSCRbqKRkAqDxbvXT5ju@@5y2@4WZ@Vxzt5bGgwKFCIOGOurMyjRiFzqcD7C1Y1UIxWoHisjJTXaB5tIw1KHCi0/J@r5YalHgkTE3k80ZFBsqXnn36DUV3Dc

@user41805 Thanks, I always wondered why it didn't work in the footer!

Rust, 43 bytes
|a:&[i8]|0==a.iter().fold(0,|a,n|a+n%2*2-1)

Attempt This Online!
Simple functional solution. Works by first calculating the parity of the number, replacing each value by -1 if even and +1 if odd using a linear function of the remainder, and then summing the results. The sum is then compared to 0 to output a boolean.

Based on our other discussion (in my solution) - you can save a few bytes by dropping the type in the closure. Technically .iter() isn't necessary either, but you might want to specify that the expected type is an iterator rather than a slice or vec. Also, I love the approach of using fold.


text:
Golf Me A Text-Editor
Golf Me a Text Editor
(similar challenges: Create a simple line editor and Line editor (more text here))
I seem to have forgotten which program to use to open, read, and write text files. Something like Noteleaf or VSBro or ... You see my conundrum. But never fear! I know some people who can write one. But I'm a bit limited on space, so shorter programs would be much appreciated.
The Challenge
Create a program, in your language of choice, that can open, read, and write plaintext files. The program should take input from your language's equivalent of STDIN and write the contents of the file to STDOUT (or equivalent). The program should close the file after the user is done with it (when they type 'q'). If the file does not exist, then the program should create a new one with the given filename. Editing is done line-by-line. The user gives the line number they wish to edit, and then give the new content of that line. If there is no content given, the line should be removed. Additional specifications are listed below.
Commands
filename?> - opens the specified file. If a file with the given name can not be found, create a new file. If the user types DELETE, then the program should prompt with delete?>.
delete?> - "deletes" the file. This is done by blanking it (i.e. replacing its contents with ""), which will suffice for this challenge. If the file can not be found, then print FILE NOT FOUND.
line?> - the given line number is where the text will be changed when content?> is given. If q is entered, then close the file and exit. If a is entered, then append a new empty line to the end of the file. If the index is out of bounds (i.e. does not exist (the text files can be 1 or 0 based indexed)) then print Error!.
content?> - input that is given here will replace that of the previous content of the line given earlier (line?>). If empty then delete that line (remove content from the line and shift all lines after it up one).
After each filename?> and content?> the contents of the file should be printed, as well as -- followed by the number of lines in the file.
Examples
A (rather bad) example program in Python3 can be found here.
Example deletions:
filename?>DELETE
delete?>passwords.txt

filename?>DELETE
delete?>evidence.txt
FILE NOT FOUND

Example run:
filename?>passwords.txt
password
admin
1234
********
p@$$w0rd
c0d3_1$_l!f3
--
6
line?>3
content?>12345678
password
admin
12345678
********
p@$$w0rd
c0d3_1$_l!f3
--
6
line?>4
content?>
password
admin
12345678
p@$$w0rd
c0d3_1$_l!f3
--
6
line?>a
password
admin
12345678
p@$$w0rd
c0d3_1$_l!f3

--
7
line?>9
Error!

line?>1
content?>passcode
passcode
admin
12345678
p@$$w0rd
c0d3_1$_l!f3

--
7
line?>5
content?>
password
admin
12345678
p@$$w0rd

--
6
line?>q

Remember, this is code-golf, so the shortest answer in bytes wins!

Is the “FILE NOT FOUND” error only visible in sample code and sample run mandatory?

@manatwork. Yes. I thought I had made it mandatory, but I must have forgotten when I created the list of commands. Edited.

The file handling could benefit of some clarifications. Do we have to care about directories and lack of permissions, or we can assume only names of readable & writable regular files will be typed in?

How does the user create a file called DELETE?

@manatwork you do not have to deal with directories or lack of permissions. Assume only names of readable and writable regular text files (*.txt) will be inputted.

@Abigail they can’t. They could, however, create a file named DELETE.txt.

Use the path, @Abigail. https://pastebin.com/VHPGDuck

What happens after Error! or FILE NOT FOUND?

Please avoid making assumptions about language features, here regarding "opening" and "closing" files.

@Adám Do you have any suggestions for better word choice?

To closers: a little more specifics on what exactly I need to clarify, please. I though I was being detailed enough

I didn't vote-to-close, but perhaps you could add an explanation to the "Example run" section. Currently, it's hard to tell what the example run is even doing without being first shown the contents of the file(s) it's operating on

Bash, 388 375 characters
Note that I am aware that further clarifications may come which will invalidate my solution.
Feel free to carry out any necessary modification in the requirement.
I posted this because the challenge is complex and may help to see how someone else understood it when editing for clarification.
set -f
IFS=
read -pfilename?\> f
[ $f = DELETE ]&&{
read -pdelete?\> f
[ -f $f ]&&>$f||echo FILE NOT FOUND
exit
}
[ -f $f ]&&mapfile t<$f
echo "${t[*]}--"
while read -plineno?\> l;do
[ $l = q ]&&break
[ $l = a ]&&t+=('
')||{ ((l>=${#t[@]}))&&echo Error!&&continue
read -pcontent?\> c
[ $c ]&&t[l]="$c
"||t=(${t[@]::l} ${t[@]:l+1})
}
echo "${t[*]}--"
done
echo -n "${t[*]}">$f

Thanks to:

GammaFunction for suggesting set -f to make some quoting unnecessary (13 characters).

I think with set -f you could unquote a lot of things, and use [ instead of [[.

Zsh, 309 bytes
p(){print -l - "$t[@]" -- $#t}
read f'?filename?>'
[ $f = DELETE ]&&{
read f'?delete?>'
[ -f $f ]&&:>$f||echo FILE NOT FOUND
exit}
[ -f $f ]&&t=("${(@f)"$(<$f)"}")
p
while read l'?lineno?>'&&[ ${l/q} ];do
[ $l = a ]&&t+=('')||{((l&&l<=$#t))&&read c'?content?>'&&t[l]=($c);}||echo Error!
p
done
<<<${(F)t}>"$f"

Compared to Bash, we use [ instead of [[, get rid of unnecessary quotes (although many are still necessary due to $foo expanding to no words if foo is empty. We take advantage of this with the array[index]=(a list) syntax to insert in a new line unless $c is empty, in which case t[l]=() deletes it.