Problem The purpose of the following code is to, given a vector, compute the two accumulators: 1. head-till-nth element, 2. […]

# Tag: clojure

## Filtering a data structure using regex predicates

Problem Assume we have a data-structure like this: (def data (atom [{:id 1 :first-name “John1” :last-name “Dow1” :age 14} {:id […]

## naive bayes sentiment analysis classifier in clojure

Problem attaching my try on implementing simple naive-bayes classifier for sentiment analysis as part of learning clojure and using functional […]

## Clojure koans 14 – converting a map to a string

Problem The koan is at the end of this snippet. It requires you to write a function to convert a […]

## Getting rid of extra test during initialization of loop/recursion

Problem I’m reluctant to ask this question. My code below works, it’s intelligible, and it seems reasonably efficient. It’s just […]

## Number of Chocolates to Gluttonize in Clojure

Problem I’ve been dabbling in Clojure by solving programming puzzles. This particular puzzle is from HackerRank, with the objective of […]

## Clojure code adapted from map-invert

Problem I wanted to do the following: Count the frequencies of words in a text (over 5 letters) Invert the […]

## Project Euler #1

Problem I’m learning Clojure and solved Project Euler #1, I’d like to have my code reviewed on all aspects and […]

## Finding the sum of the digits appearing in the leaves via in-order traversal

Problem The following text is an in-order traversal of a binary tree with 1023 nodes. What is the sum of […]

## Project Euler Problem 14 in Clojure

Problem I recently began learning Clojure. In order to get better acquainted with it, I’ve been tackling Project Euler challenges. […]