Skip to content

Instantly share code, notes, and snippets.

@trayforyou
Created April 29, 2024 08:01
Show Gist options
  • Save trayforyou/e71560112671f1a13ea17b859d82f19d to your computer and use it in GitHub Desktop.
Save trayforyou/e71560112671f1a13ea17b859d82f19d to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Xml.Linq;
namespace Collections4
{
internal class Program
{
static void Main(string[] args)
{
string[] numbers1 = { "1", "2", "1" };
string[] numbers2 = { "3", "2" };
List<string> sortingNumbers = new List<string>();
SortNumbers1(numbers1,ref sortingNumbers);
SortNumbers1(numbers2,ref sortingNumbers);
}
private static void SortNumbers1(string[] numbers,ref List<string> sortingNumbers)
{
for (int i = 0; i <numbers.Length; i++)
{
if (sortingNumbers.Contains(numbers[i]))
{
continue;
}
else
{
sortingNumbers.Add(numbers[i]);
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment