RemoveAt method removing dont remove at index : I have a little problem and im not sure where is it.Im still learing to coding and my exercise are to sum equal numbers in List<>,but when im using RemoveAt(int index), he dont remove at index,he removing last index from the whole list and everything gone wrong? Could u help me :) Thats my method :) 

private static int GetNumberFromInput(List<int> input)
        {
           
            int sum = 0;

            for (int i = 0; i < input.Count; i++)
            {
                if (i == input.Count - 1)
                {
                    break;
                }

                if (input[i] == input[i + 1])
                {
                    sum = input[i] + input[i + 1];
                    input.RemoveAt(i);
                    input[i] = sum;
                    i--;
                }

                if (input[i] != input[i + 1])
                {
                    if(input[i+1] == input[i + 2])
                    {
                        sum = input[i + 1] + input[i + 2];
                        input.RemoveAt(input[i + 1]);
                        input[i + 1] = sum;
                    }
                    i--;
                }
            }

            return sum;
        }
