In a problem, I need to know which string elements are same among two 2d strings and I have implemented it by using two loops. As the string length is high, I eventually got a time limit exit as a verdict. Now how can I compare these 2 2d strings in less time?