• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Clojure programming problem hash-map assoc/dissoc

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to solve a programming problem where i am inputting a series of strings and i want to only return strings that cannot be made into any other word in the strings list.

So i have came up with a solution in Cloujure but it cant seem to get the correct output. My function changes all strings to lowercase, then orders the words, then i make a map of all the words in the list so it will look like this in map1


Then i want to only extract the entry {"enp" "pen"} as that is the only entry in the map thats key doesnt match any other key in the map





This solution just gives me this output
([{}] [{}] [{}] [{}] [{}] [{}] [{}])

How will i get the output to only give me {"pen" "pen"} Or is this solution impossible to achieve what i want??
 
Rancher
Posts: 379
22
Mac OS X Monad Clojure Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps better to keep this all under the original thread where everyone will have the full context of what you've tried?

https://coderanch.com/t/661478/clojure/Java-Clojure-Trouble-function
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic