Count the number of leaders in both sides (slices) of an array in C#. Codility EquiLeaders task
If you need to get a value of a Dictionary&lt;TKey, TValue&gt; you shouldn't us ContainsKey() together with the Item property getter but TryGetValue(), because by using ContainsKey() in combination with the Item getter you are doing the check if the key exists twice.
From the refernce source  

public bool ContainsKey(TKey key)
{
    if (key == null) throw new ArgumentNullException("key");

    TValue throwAwayValue;
    return TryGetValue(key, out throwAwayValue);
}

public TValue this[TKey key]
{
    get
    {
        TValue value;
        if (!TryGetValue(key, out value))
        {
            throw new KeyNotFoundException();
        }
        return value;
    }
    set
    {
        if (key == null) throw new ArgumentNullException("key");
        TValue dummy;
        TryAddInternal(key, value, true, true, out dummy);
    }
}

Multiple declarations of variables on a single line should be avoided because it reduces the readability of the code.  
If the type is clear from the right-hand-side of an assignment one should use var instead of the concrete type.  
You should declare the variables as near to their usage as possible. This makes reading the code easier as well.  
Althought this is from a programming excercise please note that methods should be named using PascalCase casing and method parameters should be named using camelCasecasing. Meaning solution should be Solution and A should be a if we talk about casing.


Implementing the mentioned points (without casing stuff) will look like this  

public int solution(int[] A)
{
    var leftPartition = new Dictionary&lt;int, int&gt;();
    var rightPartition = new Dictionary&lt;int, int&gt;();

    for (var index = A.Length - 1; index &gt;= 0; index--)
    {
        var candidate = A[index];
        rightPartition.TryGetValue(candidate, out int value);
        rightPartition[candidate] = value + 1;
    }

    var leadersCounter = 0;
    var leftPartitionSize = 1;
    var rightPartitionSize = A.Length;
    var leader = A[0];

    for (var index = 0; index &lt; A.Length; index++)
    {
        var candidate = A[index];

        leftPartition.TryGetValue(candidate, out int value);
        leftPartition[candidate] = value + 1;

        rightPartition[candidate]--;
        rightPartitionSize--;

        if (leftPartition[candidate] &gt; leftPartitionSize / 2)
        {
            leader = candidate;
        }
        if (leftPartition[leader] &gt; leftPartitionSize / 2 &amp;&amp; rightPartition[leader] &gt; rightPartitionSize / 2)
        {
            leadersCounter++;
        }
        leftPartitionSize++;
    }
    return leadersCounter;
}