Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
down the 🐰 hole and back solution in Clear category for [old] The Tower by vincent.tscherter
"use strict";
// my little minions
String.prototype.rev = function () { return [...this].reverse().join('') };
Array.prototype.max = function () { return Math.max(...this) };
// my littel beauty
var tower = cubes => [
// get cubes orientet in x-, y- & z-direction
cubes = cubes.map ( c => ['0132', '4152', '0534'].
map( x => [...x].map( x => c[+x]).join(''))),
// filter out not matching cubes and return resulting heights
cubes.map( a => a.map( b => cubes.filter( c => c.some( d =>
(b+b+' '+(b+b).rev()).includes(d))).length).max()).max()][1];
Sept. 30, 2018
Comments: