Question: Given an arraylist of Strings, write a method that checks if any two strings in the arraylist when concatenated is identical to any other String
Given an arraylist of Strings, write a method that checks if any two strings in the arraylist when concatenated is identical to any other String in the arraylist. For example, if the arraylist has [cat, dog, dot, ca, t, do,t,g], then the answer would be to print Yes, ca at location 3 and t at location 4 together form cat at location 0. Of course, there are other answers too, for instance, do and t form dot or do and g form dog. Any one answer is good enough. Concatenate operation is done by the usual + in Java. Estimate your algorithms run-time comple
trying to do this in java
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
