Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

wordlen challenge

Hi,

I am working on below challenge.
http://codingbat.com/prob/p125327

public Map<String, Integer> wordLen(String[] strings) {
  
  
  
  int len=strings.length;
   Map<String, Integer> map = new HashMap<String, Integer>();
 for(int i=0;i<len;i++){
   
 map.put(strings[i],strings[i].length());
 }
  return map;
//}

}

Open in new window

i passed all tests. any improvements or alternate approaches? please advise
ASKER CERTIFIED SOLUTION
Avatar of dpearson
dpearson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER