Yesterday, I left my sandwich on the table. When I got up today, there was a bite in it... Was it mine? I can't remember...
Problem:
Take a representation of the sandwich and my bite pattern and tell me if it was my bite or not.
Examples:
Example 1:
My bite pattern:
..
.
Sandwich:
#####
.####
..###
Output:
truthy
Example 2:
My bite pattern:
..
..
Sandwich:
...##
..###
.####
Output:
falsy
Example 3:
If there is at least 1 rotation that counts as truthy, the output is truthy.
My bite pattern:
.
.
.
Sandwich:
##.
#.#
.##
Output:
Two possible rotations (biting in the northeast or southwest corner).
truthy
Some valid bites:
..
.
...
.
.
.
.
.
..
. .
..
..
.
. .
Some invalid bites:
..
...
.
..
.
.
Rules:
My bite pattern orientation will always be for biting the northwest corner. And must be rotated to bite other corners;
There will always be 1 and only 1 bite in the sandwich;
The bite in the sandwich can be in any of the 4 cornes (rotated accordingly);
Bite patterns will always be symmetrical along the main diagonal;
Bite patterns will always be at least 1 wide and non empty;
The sandwich will always be a rectangle with width and height equal or greater than the width of my bite pattern;
In your input, you can choose any 2 distinct non-whitespace characters to represent the sandwich and the bite;
Spaces in the bite pattern means that my bite does not touch that part of the sandwich.
..
,..
? \$\endgroup\$