02. Easter Gifts- Technology Fundamentals Retake Mid Exam - 16 April 2019 (maybe Judge problem)
Please, can somebody try to submit for this exercise https://judge.softuni.bg/Contests/Practice/Index/1610#1 ? I think maybe their is a problem in Judge System, because I can't to submit my solution. Only showed this message "The contest cannot be practiced!". On my computer there is no problem, everything is ok.
You can check with my code:
using System;
using System.Collections.Generic;
using System.Linq;
namespace midExamFinal
{
class MainClass
{
public static void Main(string[] args)
{
List<string> listOfGifts = Console.ReadLine().Split().ToList();
string command = string.Empty;
while ((command = Console.ReadLine()) != "No Money")
{
string[] commandArray = command.Split();
if (commandArray[0] == "OutOfStock")
{
string gift = commandArray[1];
while (listOfGifts.Exists(x => x == gift))
{
int indexOfGift = listOfGifts.IndexOf(gift);
listOfGifts[indexOfGift] = "None";
}
}
else if (commandArray[0] == "Required")
{
string gift = commandArray[1];
int index = int.Parse(commandArray[2]);
if (index >= 0 && index <= listOfGifts.Count - 1)
{
listOfGifts[index] = gift;
}
}
else if (commandArray[0] == "JustInCase")
{
string gift = commandArray[1];
listOfGifts[listOfGifts.Count - 1] = gift;
}
}
var result = listOfGifts.Where(x => x != "None");
Console.WriteLine(string.Join(" ",result));
}
}
}
Hi Elena,
Due to the recent problems with the judge-system (lags up to 20 minutes), the SoftUni dev-team are currently working on the system. Access should be re-established on Monday, so try to submit your applications again after the weekend (I still see the exam you mentioned on the list, so everything should be running OK when submitting a solution).
Best,
Axiomatic,
thanks again.
I would be trying to submit tomorrow.
I hope everything will be ok.
Have a nice weekend!
Elena