# Diyar Faraj's Blog

## Kattis solution C#: Transit Woes

Ok, Yraglac's Transit Woes is definitely on the easiest problems in the whole Kattis problems register.

But somehow I got stuck on this for quite some time. Specifically on the fourth input line about the arrivals, it goes like this:

The fourth line contains n space separated integers Ci (1≤Ci≤1000) denoting the intervals the i-th bus arrives.

I'm well aware that my solution below is far from perfect in a sense of that algorithmic thinking that most Kattis problems are aiming for.

I would love to hear some feedback if you somehow end up here. You can find more solutions at this Github repo of mine.

Still, it felt great once the it passed all the tests, here it is:

``````using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
static void Main(string[] args)
{

int s = int.Parse(input);
int t = int.Parse(input);
int n = int.Parse(input);

List<int> walks = new List<int>();
foreach (var item in input2)
{
walks.Take(n + 1);
}

List<int> drives = new List<int>();
foreach (var item in input3)
{
drives.Take(n);
}

List<int> arrivals = new List<int>();
foreach (var item in input4)
{
arrivals.Take(n);

}
List<int> arrivalArr = new List<int>();
for (int i = 0; i < arrivals.Count; ++i)
{
int diff = i == 0 ? arrivals - 1 : arrivals[i] - arrivals[i - 1];

}

s += walks.Sum();
s += drives.Sum();
s += arrivalArr.Sum();

if (s > t)
{
Console.WriteLine("no");
}
else
{
Console.WriteLine("yes");
}