{"id":708,"date":"2005-08-30T13:14:32","date_gmt":"2005-08-30T17:14:32","guid":{"rendered":"http:\/\/wordpress.cephas.net\/?p=708"},"modified":"2005-08-30T13:14:32","modified_gmt":"2005-08-30T17:14:32","slug":"java-collections-and-multimap","status":"publish","type":"post","link":"https:\/\/cephas.net\/blog\/2005\/08\/30\/java-collections-and-multimap\/","title":{"rendered":"Java, Collections and Multimap"},"content":{"rendered":"<p>I was in an interview recently and was asked a question which I thought the interviewer called an &#8216;atagram&#8217;, but I think it was actually an anagram.  He asked how you could find the largest word in a dictionary where subtracting one letter results in another word (ie: &#8216;beat&#8217; minus &#8216;e&#8217; could be &#8216;tab&#8217;).  I didn&#8217;t come up with an suitable answer during the interview, but during some unrelated reading this week I came across the question and the answer: multimap.  Scroll down to the bottom of this page and start reading when you get to <a href=\"http:\/\/java.sun.com\/docs\/books\/tutorial\/collections\/interfaces\/map.html\">multimaps<\/a>. The trick is that a multimap allows one key to map to multiple values and by alphabetizing each word in the dictionary and then placing the word in the map keyed by the alphabetized word, you can easily find all the available words which result from word minus letter.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I was in an interview recently and was asked a question which I thought the interviewer called an &#8216;atagram&#8217;, but I think it was actually an anagram. He asked how you could find the largest word in a dictionary where subtracting one letter results in another word (ie: &#8216;beat&#8217; minus &#8216;e&#8217; could be &#8216;tab&#8217;). I &hellip; <a href=\"https:\/\/cephas.net\/blog\/2005\/08\/30\/java-collections-and-multimap\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Java, Collections and Multimap<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,2],"tags":[],"_links":{"self":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/708"}],"collection":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/comments?post=708"}],"version-history":[{"count":0,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/posts\/708\/revisions"}],"wp:attachment":[{"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/media?parent=708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/categories?post=708"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cephas.net\/blog\/wp-json\/wp\/v2\/tags?post=708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}