求解长方体索玛【难度:2级】:
答案1:
using System;
using System.Collections.Generic;
using System.Linq;
public class SomaCuboidSolver
{
public static string[, ,] Solve(int w, int h, int d, Dictionary<string, bool[, ,]> pieces)
{
string[, ,] solution = new string[w, h, d];
return TryPiece(solution, pieces.AsEnumerable().Select(p => new Piece(p.Key, p.Value)).ToList(), 0) ? solution : null