![]() ![]() ®Q # Check if this is equal to block-size `®` S # Swap so the list of characters is at the top again S # Convert the current block to a flattened list of characters # divide a row or column into size `y` with builtin `ô`) Ε # Map over each `y` by `y` sized block (or smaller, if we couldn't €` # Flatten this list of lists of blocks one level down © # Also store block-size `y` in variable `®` (without popping) Y ô # And split it into blocks of size `y` again Δ # Map over each string in the (implicit) input-list: Δ # Find the first block-size `y` which is truthy for: Extract the last 1-based index of 1Ġ5AB1E, 27 bytes SgLR.Δδôøy©δô€`εSDËsgt®Q*}PĮxplanation: S # Convert the (implicit) input-list of strings to a flattened list of Test if all ixi blocks of M are validġ i:~0, NB. Test if every 2D cell of A exists as a cell in B B: 3D block having two layers: ixi of 1's and ixi of NB. (when some padding exists, the test always fails)Ġ 1+[$1: NB. A: Extract ixi blocks of M, padding with zeros ![]() For each layer of above and the entirety of matrix M. 3D block, each layer is 2x2 matrix of i where i <- 1.n The input format is a matrix of 1's and 2's. Concatenate the two results and GCD reduce
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |