# programming kata

## Programming Kata Day 8

Problem Write a function steps, that takes a sequence and makes a deeply nested structure from it: (steps [1 2 3 4]) ;=> [1 [2 [3 [4 []]]]] Solution 1 (defn steps s) Solution 2 Lazy version: (defn lz-steps s) Note To see the difference, call the function like this:

## Programming Kata Day 7

Problem Suppose a binary tree structure looks like this: {:val value :L <left-node> :R <right-node>} Write a function to balance insert node into the tree. Solution (defn insert tree x) Note Here is the function to traverse the tree: (defn traverse tree) Here is a helper function to create a tree.

## Programming Kata Day 6

Problem Write a function to determine if a vector contains a set of items. Solution (defn containsv v & items) Note Using a set as the predicate supplied to some allows you to check whether any of the truthy values in the set are contained within the given sequence. This is a frequently used Clojure idiom for searching for containment within a sequence.