Win a copy of Head First Android this week in the Android forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

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: 357
21
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic