This content has been marked as final. Show 7 replies
Disregard. I just bothered to read, found out thatI was not asking to solve the whole problem. I will solve the question myself, but I was not clear with the problem statement. Can you please explaing the problem statement clearly regarding what i have to do exactly.
it's nothing but a homework question, and stopped
bothering again. If you want it solved, go to
www.rentacoder.com and at least pay for their effort.
I think you found that question in myjavaserver.com
Heres some simple logic on how to solve your problem.
You have to return a value of the key that is the nearest match to the
You can do it from backwords.
Suppose you got the string 'givemehandler'
and in your array you have 'giveme'
1. check if the received key matches the key in the array.
2. if yes return its value.
3. if no remove the last character of the received key and go to step 1.
4. if none matches then return the default value or error.