I need some help in JAVA: I have a function signature which I can't change, and my function needs to be recursive and to return String array without any option to add it to the signature.
This is the signature I've got:
public String[] findSimilar(String w, int index, int k)
The function looks for similar words in a TRIE structure, with a difference of K letters changes between them.
For example- in a TRIE withe the words hello, nice, nine, cry, for the word "bike" and k=2, the function will return a String[] with nice and nine.
I'm not looking for a solution, just for a method to return string array.
** I wrote a function with the signature I've received as a wrapper, but I just found out that I can't use wrapper.
Thank you!
return collection.toArray(new String[0]);