10
3
Challenge
Create a function takes in two 2-dimensional arrays of Characters (or Strings if the programming language does not have characters as a datatype) as inputs: a and b. If your language does not support these inputs, you may use any other standard one-byte variable.
Your task is to determine if b contains a. If this is so, return true. Otherwise, return false.
Sample Test Cases
a:
123
456
789
b:
123
456
789
should return true.
a:
code
golf
b:
thisis
code!!
golf!!
ohyeah
should return true.
a:
abcd
efgh
ijkl
b:
abcdef
ghijkl
mnopqr
should return false.
a:
abc
def
b:
1abc2
3def4
5ghi6
should return true
a:
ab
cd
b:
#ab##
##cd#
should return false
Least bytes wins.
2
Hi and welcome to codegolf! I edited your test cases to (hopefully) make them a bit more clear. Note that we have a sandbox for working on challenges before posting them to main. Good luck!
– FryAmTheEggman – 2019-05-04T19:35:02.9172Also, may I take the first array as an array of strings and the second as a string separated by newlines, even though my language(C#) has a character type built in? – Embodiment of Ignorance – 2019-05-04T21:07:08.957
@Neil Test cases 2 and 3 are not square. – Robin Ryder – 2019-05-04T21:16:25.737
5Could you add a truthy test case where
aisn't onb's left edge and a falsey test case where each line ofaappears in consecutive lines ofbbut with their left edges staggered? – Shaggy – 2019-05-04T21:34:25.323@EmbodimentofIgnorance yes – Hazard – 2019-05-05T21:40:07.273
Please add test cases:
['abc','def'], ['1abc2abc7','3abc4xxx8','5ghi6'] -> falseand['abc','def'],['1abc2abc7','3abc4def8','5ghi6'] -> true– mazzy – 2019-05-06T13:52:31.930What's the minimum grid size? If it's 1x1, I recommend test cases involving a 1xY and Yx1 grid. – Veskah – 2019-05-16T19:08:24.890