'How can i build a code which tells me that all the int's "connects" or not?
I want to make code which tells me that can I build a path using all the dominoes or not. Here is what the input looks like:
int N = int.Parse(Console.ReadLine());
int[,] dominok = new int[N, 2];
for (int i = 0; i < N; i++)
{
string temp =Console.ReadLine();
dominok[i, 0] = int.Parse(temp.Split('|')[0]);
dominok[i, 1] = int.Parse(temp.Split('|')[1]);
}
N represents the amount of dominoes, and then I add dominoes like this: 1|2, 4|1, etc.
The first idea that came to my mind was to count occurrence of all numbers and do something with that. Can someone help me with this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
