#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
vector<vector<string> > ptextarr = {{"this", "is", "a", "test"},
{"this"},
{"is", "one", "as", "well"},
{"the", "word", "root", "is", "here"},
{"and", "here:", "root"}};
for(size_t n = 0; n < ptextarr.size(); ++n)
{
auto i = find(ptextarr[n].begin(), ptextarr[n].end(), "root");
if(ptextarr[n].end() != i)
std::cout << "Found root at row " << n << " col " << i-ptextarr[n].begin() << '\n';
}
}
I2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpCnsKICAgIHZlY3Rvcjx2ZWN0b3I8c3RyaW5nPiA+IHB0ZXh0YXJyID0ge3sidGhpcyIsICJpcyIsICJhIiwgInRlc3QifSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsidGhpcyJ9LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyJpcyIsICJvbmUiLCAiYXMiLCAid2VsbCJ9LAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeyJ0aGUiLCAid29yZCIsICJyb290IiwgImlzIiwgImhlcmUifSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHsiYW5kIiwgImhlcmU6IiwgInJvb3QifX07CiAgICBmb3Ioc2l6ZV90IG4gPSAwOyBuIDwgcHRleHRhcnIuc2l6ZSgpOyArK24pCiAgICB7CiAgICAgICAgYXV0byBpID0gZmluZChwdGV4dGFycltuXS5iZWdpbigpLCBwdGV4dGFycltuXS5lbmQoKSwgInJvb3QiKTsKICAgICAgICBpZihwdGV4dGFycltuXS5lbmQoKSAhPSBpKQogICAgICAgICAgICBzdGQ6OmNvdXQgPDwgIkZvdW5kIHJvb3QgYXQgcm93ICIgPDwgbiA8PCAiIGNvbCAiIDw8IGktcHRleHRhcnJbbl0uYmVnaW4oKSA8PCAnXG4nOwogICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCn0=