xmlhttprequest(build5381)
public struct Problem { }
public struct Solution { }
public class Skill
{
public Solution? Solve(Problem problem)
{ throw new NotImplementedException(); }
}
// define a class to represent an engineer. Each engineer could have multiple skills.
public class Engineer
{
public string Name { get; set; }
public List<Skill> Skills { get; set; }
}
// define a class to represent a team. Each team could have multiple engineers.
public class Team
{
public string Name { get; set; }
public List<Engineer> Engineers { get; set; }
public Solution? Solve(Problem problem)
{
foreach (var engineer in Engineers)
foreach (var skill in engineer.Skills)
{
var solution = skill.Solve(problem);
if (solution != null) return solution;
}
return null;
}
}
(#14813764@0)
Last Updated: 2022-9-15
This post has been archived. It cannot be replied.