Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static int designerPdfViewer(int[] h, String word) {
- HashMap<Character,Integer> map=new HashMap<Character,Integer>();
- int i=0;int max=0;
- int length=word.length();
- for(char ch='a';ch<='z';ch++){
- map.put(ch,h[i]);
- i++;
- }
- for(int j=0;j<length;j++){
- int val=map.get(word.charAt(j));
- if(val>max)
- max=val;
- }
- System.out.println(max*length);
- return (max*length);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement