forked from PEZ/rich4clojure
-
Notifications
You must be signed in to change notification settings - Fork 0
/
problems.edn
2041 lines (2041 loc) · 117 KB
/
problems.edn
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
({:_id 1,
:description
"<p>Define `__` or replace the `__` in the `(tests ...)` form with a value which will make the test pass.</p><p>Run the test by loading the file. Once the file is loaded you can run the tests again by either reloading the file or evaluating the `(tests ...)` form.</p><p>Don't over think it! Hint: true is equal to true.</p>",
:difficulty "Elementary",
:tags [],
:tests ["(= __ true)"],
:times-solved 1432,
:title "Nothing but the Truth",
:user "dbyrne"}
{:_id 2,
:description
"<p>If you are not familiar with <a href='https://en.wikipedia.org/wiki/Polish_notation'>polish (prefix) notation</a>, simple arithmetic might seem confusing.</p><p><strong>Note:</strong> Enter only enough to fill in the blank (in this case, a single number) - do not retype the whole problem.</p>",
:difficulty "Elementary",
:tags [],
:tests ["(= (- 10 (* 2 3)) __)"],
:times-solved 1389,
:title "Simple Math",
:user "dbyrne"}
{:_id 3,
:description
"Clojure strings are Java strings. This means that you can use any of the Java string methods on Clojure strings.",
:difficulty "Elementary",
:tags [],
:tests ["(= __ (.toUpperCase \"hello world\"))"],
:times-solved 1373,
:title "Intro to Strings",
:user "dbyrne"}
{:_id 4,
:description
"<p>Lists can be constructed with either a function or a quoted form.</p><p>Note: You can't redefine `__` to solve this problem. You will need to replace `__` in the `(tests ...)` form.</p>",
:difficulty "Elementary",
:tags [],
:tests ["(= (list __) '(:a :b :c))"],
:times-solved 1294,
:title "Intro to Lists",
:user "dbyrne"}
{:description
"<p>Vectors can be constructed several ways. You can compare them with lists.\r\n</p><p>Note: You can't redefine `__` to solve this problem. You will need to replace `__` in the `(tests ...)` form.</p>",
:tags nil,
:_id 6,
:difficulty "Elementary",
:tests
["(= [__] (list :a :b :c) (vec '(:a :b :c)) (vector :a :b :c))"],
:times-solved 1177,
:title "Intro to Vectors",
:restricted nil,
:user "dbyrne"}
{:_id 7,
:description
"When operating on a Vector, the conj function will return a new vector with one or more items \"added\" to the end.",
:difficulty "Elementary",
:tags [],
:tests ["(= __ (conj [1 2 3] 4))" "(= __ (conj [1 2] 3 4))"],
:times-solved 1165,
:title "Vectors: conj",
:user "dbyrne"}
{:_id 8,
:description "Sets are collections of unique values.",
:difficulty "Elementary",
:tags [],
:tests
["(= __ (set '(:a :a :b :c :c :c :c :d :d)))"
"(= __ (clojure.set/union #{:a :b :c} #{:b :c :d}))"],
:times-solved 1128,
:title "Intro to Sets",
:user "dbyrne"
:extra-requires ["[clojure.set]"]}
{:_id 9,
:description
"When operating on a set, the conj function returns a new set with one or more keys \"added\".",
:difficulty "Elementary",
:tags [],
:tests ["(= #{1 2 3 4} (conj #{1 4 3} __))"],
:times-solved 1108,
:title "Sets: conj",
:user "dbyrne"}
{:_id 10,
:description
"Maps store key-value pairs. Both maps and keywords can be used as lookup functions. Commas can be used to make maps more readable, but they are not required.",
:difficulty "Elementary",
:tags [],
:tests
["(= __ ((hash-map :a 10, :b 20, :c 30) :b))"
"(= __ (:b {:a 10, :b 20, :c 30}))"],
:times-solved 1082,
:title "Intro to Maps",
:user "dbyrne"}
{:_id 11,
:description
"When operating on a map, the conj function returns a new map with one or more key-value pairs \"added\".",
:difficulty "Elementary",
:tags [],
:tests ["(= {:a 1, :b 2, :c 3} (conj {:a 1} __ [:c 3]))"],
:times-solved 1061,
:title "Maps: conj",
:user "dbyrne"}
{:_id 12,
:description
"All Clojure collections support sequencing. You can operate on sequences with functions like first, second, and last.",
:difficulty "Elementary",
:tags [],
:tests
["(= __ (first '(3 2 1)))"
"(= __ (second [2 3 4]))"
"(= __ (last (list 1 2 3)))"],
:times-solved 1051,
:title "Intro to Sequences",
:user "dbyrne"}
{:_id 13,
:description
"The rest function will return all the items of a sequence except the first.",
:difficulty "Elementary",
:tags [],
:tests ["(= __ (rest [10 20 30 40]))"],
:times-solved 1045,
:title "Sequences: rest",
:user "dbyrne"}
{:_id 14,
:description "Clojure has many different ways to create functions.",
:difficulty "Elementary",
:tags [],
:tests
["(= __ ((fn add-five [x] (+ x 5)) 3))"
"(= __ ((fn [x] (+ x 5)) 3))"
"(= __ (#(+ % 5) 3))"
"(= __ ((partial + 5) 3))"],
:times-solved 1038,
:title "Intro to Functions",
:user "dbyrne"}
{:_id 15,
:description "Write a function which doubles a number.",
:difficulty "Elementary",
:tags [],
:tests
["(= (__ 2) 4)" "(= (__ 3) 6)" "(= (__ 11) 22)" "(= (__ 7) 14)"],
:times-solved 1025,
:title "Double Down",
:user "dbyrne"}
{:_id 16,
:description
"Write a function which returns a personalized greeting.",
:difficulty "Elementary",
:tags [],
:tests
["(= (__ \"Dave\") \"Hello, Dave!\")"
"(= (__ \"Jenn\") \"Hello, Jenn!\")"
"(= (__ \"Rhea\") \"Hello, Rhea!\")"],
:times-solved 986,
:title "Hello World",
:user "dbyrne"}
{:_id 17,
:description
"The map function takes two arguments: a function (f) and a sequence (s). Map returns a new sequence consisting of the result of applying f to each item of s. Do not confuse the map function with the map data structure.",
:difficulty "Elementary",
:tags [],
:tests ["(= __ (map #(+ % 5) '(1 2 3)))"],
:times-solved 986,
:title "Sequences: map",
:user "dbyrne"}
{:_id 18,
:description
"The filter function takes two arguments: a predicate function (f) and a sequence (s). Filter returns a new sequence consisting of all the items of s for which (f item) returns true.",
:difficulty "Elementary",
:tags [],
:tests ["(= __ (filter #(> % 5) '(3 4 5 6 7)))"],
:times-solved 978,
:title "Sequences: filter",
:user "dbyrne"}
{:description
"Write a function which returns the last element in a sequence.",
:tags ["seqs" "core-functions"],
:_id 19,
:difficulty "Easy",
:tests
["(= (__ [1 2 3 4 5]) 5)"
"(= (__ '(5 4 3)) 3)"
"(= (__ [\"b\" \"c\" \"d\"]) \"d\")"],
:times-solved 911,
:title "Last Element",
:restricted ["last"],
:user "dbyrne"}
{:_id 20,
:description
"Write a function which returns the second to last element from a sequence.",
:difficulty "Easy",
:tags ["seqs"],
:tests
["(= (__ (list 1 2 3 4 5)) 4)"
"(= (__ [\"a\" \"b\" \"c\"]) \"b\")"
"(= (__ [[1 2] [3 4]]) [1 2])"],
:times-solved 884,
:title "Penultimate Element",
:user "dbyrne"}
{:description
"Write a function which returns the Nth element from a sequence.",
:tags ["seqs" "core-functions"],
:_id 21,
:difficulty "Easy",
:tests
["(= (__ '(4 5 6 7) 2) 6)"
"(= (__ [:a :b :c] 0) :a)"
"(= (__ [1 2 3 4] 1) 2)"
"(= (__ '([1 2] [3 4] [5 6]) 2) [5 6])"],
:times-solved 782,
:title "Nth Element",
:restricted ["nth"],
:user "dbyrne"}
{:description
"Write a function which returns the total number of elements in a sequence.",
:tags ["seqs" "core-functions"],
:_id 22,
:difficulty "Easy",
:tests
["(= (__ '(1 2 3 3 1)) 5)"
"(= (__ \"Hello World\") 11)"
"(= (__ [[1 2] [3 4] [5 6]]) 3)"
"(= (__ '(13)) 1)"
"(= (__ '(:a :b :c)) 3)"],
:times-solved 723,
:title "Count a Sequence",
:restricted ["count"],
:user "dbyrne"}
{:description "Write a function which reverses a sequence.",
:tags ["seqs" "core-functions"],
:_id 23,
:difficulty "Easy",
:tests
["(= (__ [1 2 3 4 5]) [5 4 3 2 1])"
"(= (__ (sorted-set 5 7 2 7)) '(7 5 2))"
"(= (__ [[1 2][3 4][5 6]]) [[5 6][3 4][1 2]])"],
:times-solved 650,
:title "Reverse a Sequence",
:restricted ["reverse" "rseq"],
:user "dbyrne"}
{:_id 24,
:description
"Write a function which returns the sum of a sequence of numbers.",
:difficulty "Easy",
:tags ["seqs"],
:tests
["(= (__ [1 2 3]) 6)"
"(= (__ (list 0 -2 5 5)) 8)"
"(= (__ #{4 2 1}) 7)"
"(= (__ '(0 0 -1)) -1)"
"(= (__ '(1 10 3)) 14)"],
:times-solved 722,
:title "Sum It All Up",
:user "dbyrne"}
{:_id 25,
:description
"Write a function which returns only the odd numbers from a sequence.",
:difficulty "Easy",
:tags ["seqs"],
:tests
["(= (__ #{1 2 3 4 5}) '(1 3 5))"
"(= (__ [4 2 1 6]) '(1))"
"(= (__ [2 2 4 6]) '())"
"(= (__ [1 1 1 3]) '(1 1 1 3))"],
:times-solved 697,
:title "Find the odd numbers",
:user "dbyrne"}
{:_id 26,
:description
"Write a function which returns the first X fibonacci numbers.",
:difficulty "Easy",
:tags ["Fibonacci" "seqs"],
:tests
["(= (__ 3) '(1 1 2))"
"(= (__ 6) '(1 1 2 3 5 8))"
"(= (__ 8) '(1 1 2 3 5 8 13 21))"],
:times-solved 507,
:title "Fibonacci Sequence",
:user "dbyrne"}
{:_id 27,
:description
"Write a function which returns true if the given sequence is a palindrome.<br/><br>\n Hint: \"racecar\" does not equal '(\\r \\a \\c \\e \\c \\a \\r)",
:difficulty "Easy",
:tags ["seqs"],
:tests
["(false? (__ '(1 2 3 4 5)))"
"(true? (__ \"racecar\"))"
"(true? (__ [:foo :bar :foo]))"
"(true? (__ '(1 1 3 3 1 1)))"
"(false? (__ '(:a :b :c)))"],
:times-solved 546,
:title "Palindrome Detector",
:user "dbyrne"}
{:description "Write a function which flattens a sequence.",
:tags ["seqs" "core-functions"],
:_id 28,
:difficulty "Easy",
:tests
["(= (__ '((1 2) 3 [4 [5 6]])) '(1 2 3 4 5 6))"
"(= (__ [\"a\" [\"b\"] \"c\"]) '(\"a\" \"b\" \"c\"))"
"(= (__ '((((:a))))) '(:a))"],
:times-solved 356,
:title "Flatten a Sequence",
:restricted ["flatten"],
:user "dbyrne"}
{:_id 29,
:description
"Write a function which takes a string and returns a new string containing only the capital letters.",
:difficulty "Easy",
:tags ["strings"],
:tests
["(= (__ \"HeLlO, WoRlD!\") \"HLOWRD\")"
"(empty? (__ \"nothing\"))"
"(= (__ \"$#A(*&987Zf\") \"AZ\")"],
:times-solved 444,
:title "Get the Caps",
:user "dbyrne"}
{:_id 30,
:description
"Write a function which removes consecutive duplicates from a sequence.",
:difficulty "Easy",
:tags ["seqs"],
:tests
["(= (apply str (__ \"Leeeeeerrroyyy\")) \"Leroy\")"
"(= (__ [1 1 2 3 3 2 2 3]) '(1 2 3 2 3))"
"(= (__ [[1 2] [1 2] [3 4] [1 2]]) '([1 2] [3 4] [1 2]))"],
:times-solved 339,
:title "Compress a Sequence",
:user "dbyrne"}
{:_id 31,
:description
"Write a function which packs consecutive duplicates into sub-lists.",
:difficulty "Easy",
:tags ["seqs"],
:tests
["(= (__ [1 1 2 1 1 1 3 3]) '((1 1) (2) (1 1 1) (3 3)))"
"(= (__ [:a :a :b :b :c]) '((:a :a) (:b :b) (:c)))"
"(= (__ [[1 2] [1 2] [3 4]]) '(([1 2] [1 2]) ([3 4])))"],
:times-solved 279,
:title "Pack a Sequence",
:user "dbyrne"}
{:_id 32,
:description
"Write a function which duplicates each element of a sequence.",
:difficulty "Easy",
:tags ["seqs"],
:tests
["(= (__ [1 2 3]) '(1 1 2 2 3 3))"
"(= (__ [:a :a :b :b]) '(:a :a :a :a :b :b :b :b))"
"(= (__ [[1 2] [3 4]]) '([1 2] [1 2] [3 4] [3 4]))"
"(= (__ [[1 2] [3 4]]) '([1 2] [1 2] [3 4] [3 4]))"],
:times-solved 368,
:title "Duplicate a Sequence",
:user "dbyrne"}
{:_id 33,
:description
"Write a function which replicates each element of a sequence a variable number of times.",
:difficulty "Easy",
:tags ["seqs"],
:tests
["(= (__ [1 2 3] 2) '(1 1 2 2 3 3))"
"(= (__ [:a :b] 4) '(:a :a :a :a :b :b :b :b))"
"(= (__ [4 5 6] 1) '(4 5 6))"
"(= (__ [[1 2] [3 4]] 2) '([1 2] [1 2] [3 4] [3 4]))"
"(= (__ [44 33] 2) [44 44 33 33])"],
:times-solved 331,
:title "Replicate a Sequence",
:user "dbyrne"}
{:description
"Write a function which creates a list of all integers in a given range.",
:tags ["seqs" "core-functions"],
:_id 34,
:difficulty "Easy",
:tests
["(= (__ 1 4) '(1 2 3))"
"(= (__ -2 2) '(-2 -1 0 1))"
"(= (__ 5 8) '(5 6 7))"],
:times-solved 358,
:title "Implement range",
:restricted ["range"],
:user "dbyrne"}
{:_id 35,
:description
"Clojure lets you give local names to values using the special let-form.",
:difficulty "Elementary",
:tags ["syntax"],
:tests
["(= __ (let [x 5] (+ 2 x)))"
"(= __ (let [x 3, y 10] (- y x)))"
"(= __ (let [x 21] (let [y 3] (/ x y))))"],
:times-solved 496,
:title "Local bindings",
:user "amalloy"}
{:_id 36,
:description "<p>Can you bind x, y, and z so that these are all true?</p><p>Note: You can't redefine `__` to solve this problem. You will need to replace `__` in the `(tests ...)` form.</p>",
:difficulty "Elementary",
:tags ["math" "syntax"],
:tests
["(= 10 (let __ (+ x y)))"
"(= 4 (let __ (+ y z)))"
"(= 1 (let __ z))"],
:times-solved 491,
:title "Let it Be",
:user "amalloy"}
{:_id 37,
:description
"Regex patterns are supported with a special reader tag.",
:difficulty "Elementary",
:tags ["regex" "syntax"],
:tests ["(= __ (apply str (re-seq #\"[A-Z]+\" \"bA1B3Ce \")))"],
:times-solved 468,
:title "Regular Expressions",
:user "dbyrne"}
{:description
"Write a function which takes a variable number of parameters and returns the maximum value.",
:tags ["core-functions"],
:_id 38,
:difficulty "Easy",
:tests
["(= (__ 1 8 3 4) 8)" "(= (__ 30 20) 30)" "(= (__ 45 67 11) 67)"],
:times-solved 412,
:title "Maximum value",
:restricted ["max" "max-key"],
:user "dbyrne"}
{:description
"Write a function which takes two sequences and returns the first item from each, then the second item from each, then the third, etc.",
:tags ["seqs" "core-functions"],
:_id 39,
:difficulty "Easy",
:tests
["(= (__ [1 2 3] [:a :b :c]) '(1 :a 2 :b 3 :c))"
"(= (__ [1 2] [3 4 5 6]) '(1 3 2 4))"
"(= (__ [1 2 3 4] [5]) [1 5])"
"(= (__ [30 20] [25 15]) [30 25 20 15])"],
:times-solved 321,
:title "Interleave Two Seqs",
:restricted ["interleave"],
:user "dbyrne"}
{:description
"Write a function which separates the items of a sequence by an arbitrary value.",
:tags ["seqs" "core-functions"],
:_id 40,
:difficulty "Easy",
:tests
["(= (__ 0 [1 2 3]) [1 0 2 0 3])"
"(= (apply str (__ \", \" [\"one\" \"two\" \"three\"])) \"one, two, three\")"
"(= (__ :z [:a :b :c :d]) [:a :z :b :z :c :z :d])"],
:times-solved 306,
:title "Interpose a Seq",
:restricted ["interpose"],
:user "dbyrne"}
{:_id 41,
:description
"Write a function which drops every Nth item from a sequence.",
:difficulty "Easy",
:tags ["seqs"],
:tests
["(= (__ [1 2 3 4 5 6 7 8] 3) [1 2 4 5 7 8])"
"(= (__ [:a :b :c :d :e :f] 2) [:a :c :e])"
"(= (__ [1 2 3 4 5 6] 4) [1 2 3 5 6])"],
:times-solved 276,
:title "Drop Every Nth Item",
:user "dbyrne"}
{:_id 42,
:description "Write a function which calculates factorials.",
:difficulty "Easy",
:tags ["math"],
:tests
["(= (__ 1) 1)" "(= (__ 3) 6)" "(= (__ 5) 120)" "(= (__ 8) 40320)"],
:times-solved 335,
:title "Factorial Fun",
:user "amalloy"}
{:_id 43,
:description
"Write a function which reverses the interleave process into x number of subsequences.",
:difficulty "Medium",
:tags ["seqs"],
:tests
["(= (__ [1 2 3 4 5 6] 2) '((1 3 5) (2 4 6)))"
"(= (__ (range 9) 3) '((0 3 6) (1 4 7) (2 5 8)))"
"(= (__ (range 10) 5) '((0 5) (1 6) (2 7) (3 8) (4 9)))"],
:times-solved 216,
:title "Reverse Interleave",
:user "amalloy"}
{:_id 44,
:description
"Write a function which can rotate a sequence in either direction.",
:difficulty "Medium",
:tags ["seqs"],
:tests
["(= (__ 2 [1 2 3 4 5]) '(3 4 5 1 2))"
"(= (__ -2 [1 2 3 4 5]) '(4 5 1 2 3))"
"(= (__ 6 [1 2 3 4 5]) '(2 3 4 5 1))"
"(= (__ 1 '(:a :b :c)) '(:b :c :a))"
"(= (__ -4 '(:a :b :c)) '(:c :a :b))"],
:times-solved 233,
:title "Rotate Sequence",
:user "dbyrne"}
{:_id 45,
:description
"The iterate function can be used to produce an infinite lazy sequence.",
:difficulty "Easy",
:tags ["seqs"],
:tests ["(= __ (take 5 (iterate #(+ 3 %) 1)))"],
:times-solved 342,
:title "Intro to Iterate",
:user "dbyrne"}
{:_id 46,
:description
"Write a higher-order function which flips the order of the arguments of an input function.",
:difficulty "Medium",
:tags ["higher-order-functions"],
:tests
["(= 3 ((__ nth) 2 [1 2 3 4 5]))"
"(= true ((__ >) 7 8))"
"(= 4 ((__ quot) 2 8))"
"(= [1 2 3] ((__ take) [1 2 3 4 5] 3))"],
:times-solved 277,
:title "Flipping out",
:user "dbyrne"}
{:description
"The contains? function checks if a KEY is present in a given collection. This often leads beginner clojurians to use it incorrectly with numerically indexed collections like vectors and lists.",
:tags nil,
:_id 47,
:difficulty "Easy",
:tests
["(contains? #{4 5 6} __)"
"(contains? [1 1 1 1 1] __)"
"(contains? {4 :a 2 :b} __)"
"(not (contains? [1 2 4] __))"],
:times-solved 349,
:title "Contain Yourself",
:restricted nil,
:user "dbyrne"}
{:_id 48,
:description
"The some function takes a predicate function and a collection. It returns the first logical true value of (predicate x) where x is an item in the collection.",
:difficulty "Easy",
:tags [],
:tests
["(= __ (some #{2 7 6} [5 6 7 8]))"
"(= __ (some #(when (even? %) %) [5 6 7 8]))"],
:times-solved 384,
:title "Intro to some",
:user "dbyrne"}
{:description
"Write a function which will split a sequence into two parts.",
:tags ["seqs" "core-functions"],
:_id 49,
:difficulty "Easy",
:tests
["(= (__ 3 [1 2 3 4 5 6]) [[1 2 3] [4 5 6]])"
"(= (__ 1 [:a :b :c :d]) [[:a] [:b :c :d]])"
"(= (__ 2 [[1 2] [3 4] [5 6]]) [[[1 2] [3 4]] [[5 6]]])"],
:times-solved 266,
:title "Split a sequence",
:restricted ["split-at"],
:user "dbyrne"}
{:_id 50,
:description
"Write a function which takes a sequence consisting of items with different types and splits them up into a set of homogeneous sub-sequences. The internal order of each sub-sequence should be maintained, but the sub-sequences themselves can be returned in any order (this is why 'set' is used in the test cases).",
:difficulty "Medium",
:tags ["seqs"],
:tests
["(= (set (__ [1 :a 2 :b 3 :c])) #{[1 2 3] [:a :b :c]})"
"(= (set (__ [:a \"foo\" \"bar\" :b])) #{[:a :b] [\"foo\" \"bar\"]})"
"(= (set (__ [[1 2] :a [3 4] 5 6 :b])) #{[[1 2] [3 4]] [:a :b] [5 6]})"],
:times-solved 207,
:title "Split by Type",
:user "dbyrne"}
{:_id 51,
:description
"Here is an example of some more sophisticated destructuring.",
:difficulty "Easy",
:tags ["destructuring"],
:tests
["(= [1 2 [3 4 5] [1 2 3 4 5]] (let [[a b & c :as d] __] [a b c d]))"],
:times-solved 279,
:title "Advanced Destructuring",
:user "dbyrne"}
{:description
"Let bindings and function parameter lists support destructuring.",
:tags ["destructuring"],
:_id 52,
:difficulty "Elementary",
:tests ["(= [2 4] (let [[a b c d e] [0 1 2 3 4]] __))"],
:times-solved 301,
:title "Intro to Destructuring",
:restricted nil,
:user "amalloy"}
{:_id 53,
:description
"Given a vector of integers, find the longest consecutive sub-sequence of increasing numbers. If two sub-sequences have the same length, use the one that occurs first. An increasing sub-sequence must have a length of 2 or greater to qualify.",
:difficulty "Hard",
:tags ["seqs"],
:tests
["(= (__ [1 0 1 2 3 0 4 5]) [0 1 2 3])"
"(= (__ [5 6 1 3 2 7]) [5 6])"
"(= (__ [2 3 3 4 5]) [3 4 5])"
"(= (__ [7 6 5 4]) [])"],
:times-solved 156,
:title "Longest Increasing Sub-Seq",
:user "dbyrne"}
{:description
"Write a function which returns a sequence of lists of x items each. Lists of less than x items should not be returned.",
:tags ["seqs" "core-functions"],
:_id 54,
:difficulty "Medium",
:tests
["(= (__ 3 (range 9)) '((0 1 2) (3 4 5) (6 7 8)))"
"(= (__ 2 (range 8)) '((0 1) (2 3) (4 5) (6 7)))"
"(= (__ 3 (range 8)) '((0 1 2) (3 4 5)))"],
:times-solved 170,
:title "Partition a Sequence",
:restricted ["partition" "partition-all"],
:user "dbyrne"}
{:description
"Write a function which returns a map containing the number of occurrences of each distinct item in a sequence.",
:tags ["seqs" "core-functions"],
:_id 55,
:difficulty "Medium",
:tests
["(= (__ [1 1 2 3 2 1 1]) {1 4, 2 2, 3 1})"
"(= (__ [:b :a :b :a :b]) {:a 2, :b 3})"
"(= (__ '([1 2] [1 3] [1 3])) {[1 2] 1, [1 3] 2})"],
:times-solved 193,
:title "Count Occurrences",
:restricted ["frequencies"],
:user "dbyrne"}
{:description
"Write a function which removes the duplicates from a sequence. Order of the items must be maintained.",
:tags ["seqs" "core-functions"],
:_id 56,
:difficulty "Medium",
:tests
["(= (__ [1 2 1 3 1 2 4]) [1 2 3 4])"
"(= (__ [:a :a :b :b :c :c]) [:a :b :c])"
"(= (__ '([2 4] [1 2] [1 3] [1 3])) '([2 4] [1 2] [1 3]))"
"(= (__ (range 50)) (range 50))"],
:times-solved 170,
:title "Find Distinct Items",
:restricted ["distinct"],
:user "dbyrne"}
{:_id 57,
:description
"A recursive function is a function which calls itself. This is one of the fundamental techniques used in functional programming.",
:difficulty "Elementary",
:tags ["recursion"],
:tests
["(= __ ((fn foo [x] (when (> x 0) (conj (foo (dec x)) x))) 5))"],
:times-solved 326,
:title "Simple Recursion",
:user "dbyrne"}
{:description
"Write a function which allows you to create function compositions. The parameter list should take a variable number of functions, and create a function that applies them from right-to-left.",
:tags ["higher-order-functions" "core-functions"],
:_id 58,
:difficulty "Medium",
:tests
["(= [3 2 1] ((__ rest reverse) [1 2 3 4]))"
"(= 5 ((__ (partial + 3) second) [1 2 3 4]))"
"(= true ((__ zero? #(mod % 8) +) 3 5 7 9))"
"(= \"HELLO\" ((__ #(.toUpperCase %) #(apply str %) take) 5 \"hello world\"))"],
:times-solved 167,
:title "Function Composition",
:restricted ["comp"],
:user "dbyrne"}
{:description
"Take a set of functions and return a new function that takes a variable number of arguments and returns a sequence containing the result of applying each function left-to-right to the argument list.",
:tags ["higher-order-functions" "core-functions"],
:_id 59,
:difficulty "Medium",
:tests
["(= [21 6 1] ((__ + max min) 2 3 5 1 6 4))"
"(= [\"HELLO\" 5] ((__ #(.toUpperCase %) count) \"hello\"))"
"(= [2 6 4] ((__ :a :c :b) {:a 2, :b 4, :c 6, :d 8 :e 10}))"],
:times-solved 169,
:title "Juxtaposition",
:restricted ["juxt"],
:user "dbyrne"}
{:description
"Write a function which behaves like reduce, but returns each intermediate value of the reduction. Your function must accept either two or three arguments, and the return sequence must be lazy.",
:tags ["seqs" "core-functions"],
:_id 60,
:difficulty "Medium",
:tests
["(= (take 5 (__ + (range))) [0 1 3 6 10])"
"(= (__ conj [1] [2 3 4]) [[1] [1 2] [1 2 3] [1 2 3 4]])"
"(= (last (__ * 2 [3 4 5])) (reduce * 2 [3 4 5]) 120)"],
:times-solved 119,
:title "Sequence Reductions",
:restricted ["reductions"],
:user "dbyrne"}
{:description
"Write a function which takes a vector of keys and a vector of values and constructs a map from them.",
:tags ["core-functions"],
:_id 61,
:difficulty "Easy",
:tests
["(= (__ [:a :b :c] [1 2 3]) {:a 1, :b 2, :c 3})"
"(= (__ [1 2 3 4] [\"one\" \"two\" \"three\"]) {1 \"one\", 2 \"two\", 3 \"three\"})"
"(= (__ [:foo :bar] [\"foo\" \"bar\" \"baz\"]) {:foo \"foo\", :bar \"bar\"})"],
:times-solved 197,
:title "Map Construction",
:restricted ["zipmap"],
:user "dbyrne"}
{:description
"Given a side-effect free function f and an initial value x write a function which returns an infinite lazy sequence of x, (f x), (f (f x)), (f (f (f x))), etc.",
:tags ["seqs" "core-functions"],
:_id 62,
:difficulty "Easy",
:tests
["(= (take 5 (__ #(* 2 %) 1)) [1 2 4 8 16])"
"(= (take 100 (__ inc 0)) (take 100 (range)))"
"(= (take 9 (__ #(inc (mod % 3)) 1)) (take 9 (cycle [1 2 3])))"],
:times-solved 163,
:title "Re-implement Iterate",
:restricted ["iterate"],
:user "amalloy"}
{:description
"Given a function f and a sequence s, write a function which returns a map. The keys should be the values of f applied to each item in s. The value at each key should be a vector of corresponding items in the order they appear in s.",
:tags ["core-functions"],
:_id 63,
:difficulty "Easy",
:tests
["(= (__ #(> % 5) [1 3 6 8]) {false [1 3], true [6 8]})"
"(= (__ #(apply / %) [[1 2] [2 4] [4 6] [3 6]])\n {1/2 [[1 2] [2 4] [3 6]], 2/3 [[4 6]]})"
"(= (__ count [[1] [1 2] [3] [1 2 3] [2 3]])\n {1 [[1] [3]], 2 [[1 2] [2 3]], 3 [[1 2 3]]})"],
:times-solved 154,
:title "Group a Sequence",
:restricted ["group-by"],
:user "dbyrne"}
{:_id 64,
:description
"<a href='https://clojuredocs.org/clojure_core/clojure.core/reduce'>Reduce</a> takes a 2 argument function and an optional starting value. It then applies the function to the first 2 items in the sequence (or the starting value and the first element of the sequence). In the next iteration the function will be called on the previous return value and the next item from the sequence, thus reducing the entire collection to one value. Don't worry, it's not as complicated as it sounds.",
:difficulty "Elementary",
:tags ["seqs"],
:tests
["(= 15 (reduce __ [1 2 3 4 5]))"
"(= 0 (reduce __ []))"
"(= 6 (reduce __ 1 [2 3]))"],
:times-solved 339,
:title "Intro to Reduce",
:user "citizen428"}
{:description
"Clojure has many sequence types, which act in subtly different ways. The core functions typically convert them into a uniform \"sequence\" type and work with them that way, but it can be important to understand the behavioral and performance differences so that you know which kind is appropriate for your application.<br /><br />Write a function which takes a collection and returns one of :map, :set, :list, or :vector - describing the type of collection it was given.<br />You won't be allowed to inspect their class or use the built-in predicates like list? - the point is to poke at them and understand their behavior.",
:tags ["seqs" "testing"],
:_id 65,
:difficulty "Medium",
:tests
["(= :map (__ {:a 1, :b 2}))"
"(= :list (__ (range (rand-int 20))))"
"(= :vector (__ [1 2 3 4 5 6]))"
"(= :set (__ #{10 (rand-int 5)}))"
"(= [:map :set :vector :list] (map __ [{} #{} [] ()]))"],
:times-solved 107,
:title "Black Box Testing",
:restricted
["class"
"type"
"Class"
"vector?"
"sequential?"
"list?"
"seq?"
"map?"
"set?"
"instance?"
"getClass"],
:user "amalloy"}
{:_id 66,
:description
"Given two integers, write a function which\nreturns the greatest common divisor.",
:difficulty "Easy",
:tags [],
:tests
["(= (__ 2 4) 2)"
"(= (__ 10 5) 5)"
"(= (__ 5 7) 1)"
"(= (__ 1023 858) 33)"],
:times-solved 187,
:title "Greatest Common Divisor",
:user "dbyrne"}
{:_id 67,
:description
"Write a function which returns the first x\nnumber of prime numbers.",
:difficulty "Medium",
:tags ["primes"],
:tests
["(= (__ 2) [2 3])"
"(= (__ 5) [2 3 5 7 11])"
"(= (last (__ 100)) 541)"],
:times-solved 122,
:title "Prime Numbers",
:user "dbyrne"}
{:_id 68,
:description
"Clojure only has one non-stack-consuming looping construct: recur. Either a function or a loop can be used as the recursion point. Either way, recur rebinds the bindings of the recursion point to the values it is passed. Recur must be called from the tail-position, and calling it elsewhere will result in an error.",
:difficulty "Elementary",
:tags ["recursion"],
:tests
["(= __\n (loop [x 5\n result []]\n (if (> x 0)\n (recur (dec x) (conj result (+ 2 x)))\n result)))"],
:times-solved 224,
:title "Recurring Theme",
:user "dbyrne"}
{:description
"Write a function which takes a function f and a variable number of maps. Your function should return a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping(s) from the latter (left-to-right) should be combined with the mapping in the result by calling (f val-in-result val-in-latter)",
:tags ["core-functions"],
:_id 69,
:difficulty "Medium",
:tests
["(= (__ * {:a 2, :b 3, :c 4} {:a 2} {:b 2} {:c 5})\n {:a 4, :b 6, :c 20})"
"(= (__ - {1 10, 2 20} {1 3, 2 10, 3 15})\n {1 7, 2 10, 3 15})"
"(= (__ concat {:a [3], :b [6]} {:a [4 5], :c [8 9]} {:b [7]})\n {:a [3 4 5], :b [6 7], :c [8 9]})"],
:times-solved 109,
:title "Merge with a Function",
:restricted ["merge-with"],
:user "dbyrne"}
{:description
"Write a function that splits a sentence up into a sorted list of words. Capitalization should not affect sort order and punctuation should be ignored.",
:tags ["sorting"],
:_id 70,
:difficulty "Medium",
:tests
["(= (__ \"Have a nice day.\")\r\n [\"a\" \"day\" \"Have\" \"nice\"])"
"(= (__ \"Clojure is a fun language!\")\r\n [\"a\" \"Clojure\" \"fun\" \"is\" \"language\"])"
"(= (__ \"Fools fall for foolish follies.\")\r\n [\"fall\" \"follies\" \"foolish\" \"Fools\" \"for\"])"],
:times-solved 138,
:title "Word Sorting",
:restricted nil,
:user "fotland"}
{:description
"The -> macro threads an expression x through a variable number of forms. First, x is inserted as the second item in the first form, making a list of it if it is not a list already. Then the first form is inserted as the second item in the second form, making a list of that form if necessary. This process continues for all the forms. Using -> can sometimes make your code more readable.",
:tags nil,
:_id 71,
:difficulty "Elementary",
:tests
["(= (__ (sort (rest (reverse [2 5 4 1 3 6]))))\r\n (-> [2 5 4 1 3 6] (reverse) (rest) (sort) (__))\r\n 5)"],
:times-solved 246,
:title "Rearranging Code: ->",
:restricted nil,
:user "amalloy"}
{:_id 72,
:description
"The ->> macro threads an expression x through a variable number of forms. First, x is inserted as the last item in the first form, making a list of it if it is not a list already. Then the first form is inserted as the last item in the second form, making a list of that form if necessary. This process continues for all the forms. Using ->> can sometimes make your code more readable.",
:difficulty "Elementary",
:tags [],
:tests
["(= (__ (map inc (take 3 (drop 2 [2 5 4 1 3 6]))))\n (->> [2 5 4 1 3 6] (drop 2) (take 3) (map inc) (__))\n 11)"],
:times-solved 230,
:title "Rearranging Code: ->>",
:user "amalloy"}
{:_id 73,
:description
"A <a href=\"https://en.wikipedia.org/wiki/Tic-tac-toe\">tic-tac-toe</a> board is represented by a two dimensional vector. X is represented by :x, O is represented by :o, and empty is represented by :e. A player wins by placing three Xs or three Os in a horizontal, vertical, or diagonal row. Write a function which analyzes a tic-tac-toe board and returns :x if X has won, :o if O has won, and nil if neither player has won.",
:difficulty "Hard",
:tags ["game"],
:tests
["(= nil (__ [[:e :e :e]\n [:e :e :e]\n [:e :e :e]]))"
"(= :x (__ [[:x :e :o]\n [:x :e :e]\n [:x :e :o]]))"
"(= :o (__ [[:e :x :e]\n [:o :o :o]\n [:x :e :x]]))"
"(= nil (__ [[:x :e :o]\n [:x :x :e]\n [:o :x :o]]))"
"(= :x (__ [[:x :e :e]\n [:o :x :e]\n [:o :e :x]]))"
"(= :o (__ [[:x :e :o]\n [:x :o :e]\n [:o :e :x]]))"
"(= nil (__ [[:x :o :x]\n [:x :o :x]\n [:o :x :o]]))"],
:times-solved 100,
:title "Analyze a Tic-Tac-Toe Board",
:user "fotland"}
{:_id 74,
:description
"Given a string of comma separated integers, write a function which returns a new comma separated string that only contains the numbers which are perfect squares.",
:difficulty "Medium",
:tags [],
:tests
["(= (__ \"4,5,6,7,8,9\") \"4,9\")"
"(= (__ \"15,16,25,36,37\") \"16,25,36\")"],
:times-solved 126,
:title "Filter Perfect Squares",
:user "dbyrne"}
{:_id 75,
:description
"Two numbers are coprime if their greatest common divisor equals 1. Euler's totient function f(x) is defined as the number of positive integers less than x which are coprime to x. The special case f(1) equals 1. Write a function which calculates Euler's totient function.",
:difficulty "Medium",
:tags [],
:tests
["(= (__ 1) 1)"
"(= (__ 10) (count '(1 3 7 9)) 4)"
"(= (__ 40) 16)"
"(= (__ 99) 60)"],
:times-solved 92,
:title "Euler's Totient Function",
:user "dbyrne"}
{:_id 76,
:description
"The trampoline function takes a function f and a variable number of parameters. Trampoline calls f with any parameters that were supplied. If f returns a function, trampoline calls that function with no arguments. This is repeated, until the return value is not a function, and then trampoline returns that non-function value. This is useful for implementing mutually recursive algorithms in a way that won't consume the stack.",
:difficulty "Medium",
:tags ["recursion"],
:tests
["(= __\n (letfn\n [(foo [x y] #(bar (conj x y) y))\n (bar [x y] (if (> (last x) 10)\n x\n #(foo x (+ 2 y))))]\n (trampoline foo [] 1)))"],
:times-solved 117,
:title "Intro to Trampoline",
:user "dbyrne"}
{:_id 77,
:description
"Write a function which finds all the anagrams in a vector of words. A word x is an anagram of word y if all the letters in x can be rearranged in a different order to form y. Your function should return a set of sets, where each sub-set is a group of words which are anagrams of each other. Each sub-set should have at least two words. Words without any anagrams should not be included in the result.",
:difficulty "Medium",
:tags [],
:tests
["(= (__ [\"meat\" \"mat\" \"team\" \"mate\" \"eat\"])\n #{#{\"meat\" \"team\" \"mate\"}})"
"(= (__ [\"veer\" \"lake\" \"item\" \"kale\" \"mite\" \"ever\"])\n #{#{\"veer\" \"ever\"} #{\"lake\" \"kale\"} #{\"mite\" \"item\"}})"],
:times-solved 96,
:title "Anagram Finder",
:user "dbyrne"}
{:description
"Reimplement the function described in <a href=\"76\"> \"Intro to Trampoline\"</a>.",
:tags ["core-functions"],
:_id 78,
:difficulty "Medium",
:tests
["(= (letfn [(triple [x] #(sub-two (* 3 x)))\n (sub-two [x] #(stop?(- x 2)))\n (stop? [x] (if (> x 50) x #(triple x)))]\n (__ triple 2))\n 82)"
"(= (letfn [(my-even? [x] (if (zero? x) true #(my-odd? (dec x))))\n (my-odd? [x] (if (zero? x) false #(my-even? (dec x))))]\n (map (partial __ my-even?) (range 6)))\n [true false true false true false])"],
:times-solved 86,
:title "Reimplement Trampoline",
:restricted ["trampoline"],
:user "dbyrne"}
{:description
"Write a function which calculates the sum of the minimal path through a triangle. The triangle is represented as a collection of vectors. The path should start at the top of the triangle and move to an adjacent number on the next row until the bottom of the triangle is reached.",
:tags ["graph-theory"],
:_id 79,
:difficulty "Hard",
:tests
["(= 7 (__ '([1]\r\n [2 4]\r\n [5 1 4]\r\n [2 3 4 5]))) ; 1->2->1->3"
"(= 20 (__ '([3]\r\n [2 4]\r\n [1 9 3]\r\n [9 9 2 4]\r\n [4 6 6 7 8]\r\n [5 7 3 5 1 4]))) ; 3->4->3->2->7->1"],
:times-solved 72,
:title "Triangle Minimal Path",
:restricted nil,
:user "dbyrne"}
{:_id 80,
:description
"A number is \"perfect\" if the sum of its divisors equal the number itself. 6 is a perfect number because 1+2+3=6. Write a function which returns true for perfect numbers and false otherwise.",
:difficulty "Medium",
:tags [],
:tests
["(= (__ 6) true)"
"(= (__ 7) false)"
"(= (__ 496) true)"
"(= (__ 500) false)"
"(= (__ 8128) true)"],
:times-solved 118,
:title "Perfect Numbers",
:user "dbyrne"}
{:description
"Write a function which returns the intersection of two sets. The intersection is the sub-set of items that each set has in common.",
:tags ["set-theory"],
:_id 81,
:difficulty "Easy",
:tests
["(= (__ #{0 1 2 3} #{2 3 4 5}) #{2 3})"
"(= (__ #{0 1 2} #{3 4 5}) #{})"
"(= (__ #{:a :b :c :d} #{:c :e :a :f :d}) #{:a :c :d})"],
:times-solved 150,
:title "Set Intersection",
:restricted ["intersection"],
:user "dbyrne"}
{:_id 82,
:description
"A word chain consists of a set of words ordered so that each word differs by only one letter from the words directly before and after it. The one letter difference can be either an insertion, a deletion, or a substitution. Here is an example word chain:<br/><br/>cat -> cot -> coat -> oat -> hat -> hot -> hog -> dog<br/><br/>Write a function which takes a sequence of words, and returns true if they can be arranged into one continuous word chain, and false if they cannot.",
:difficulty "Hard",
:tags ["seqs"],
:tests
["(= true (__ #{\"hat\" \"coat\" \"dog\" \"cat\" \"oat\" \"cot\" \"hot\" \"hog\"}))"
"(= false (__ #{\"cot\" \"hot\" \"bat\" \"fat\"}))"
"(= false (__ #{\"to\" \"top\" \"stop\" \"tops\" \"toss\"}))"
"(= true (__ #{\"spout\" \"do\" \"pot\" \"pout\" \"spot\" \"dot\"}))"
"(= true (__ #{\"share\" \"hares\" \"shares\" \"hare\" \"are\"}))"
"(= false (__ #{\"share\" \"hares\" \"hare\" \"are\"}))"],
:times-solved 48,
:title "Word Chains",
:user "dbyrne"}
{:_id 83,
:description
"Write a function which takes a variable number of booleans. Your function should return true if some of the parameters are true, but not all of the parameters are true. Otherwise your function should return false.",
:difficulty "Easy",
:tags [],
:tests
["(= false (__ false false))"
"(= true (__ true false))"
"(= false (__ true))"
"(= true (__ false true false))"
"(= false (__ true true true))"
"(= true (__ true true true false))"],
:times-solved 184,
:title "A Half-Truth",
:user "cmeier"}
{:_id 84,
:description
"Write a function which generates the <a href=\"https://en.wikipedia.org/wiki/Transitive_closure\">transitive closure</a> of a <a href=\"https://en.wikipedia.org/wiki/Binary_relation\">binary relation</a>. The relation will be represented as a set of 2 item vectors.",
:difficulty "Hard",
:tags ["set-theory"],
:tests
["(let [divides #{[8 4] [9 3] [4 2] [27 9]}]\n (= (__ divides) #{[4 2] [8 4] [8 2] [9 3] [27 9] [27 3]}))"
"(let [more-legs\n #{[\"cat\" \"man\"] [\"man\" \"snake\"] [\"spider\" \"cat\"]}]\n (= (__ more-legs)\n #{[\"cat\" \"man\"] [\"cat\" \"snake\"] [\"man\" \"snake\"]\n [\"spider\" \"cat\"] [\"spider\" \"man\"] [\"spider\" \"snake\"]}))"
"(let [progeny\n #{[\"father\" \"son\"] [\"uncle\" \"cousin\"] [\"son\" \"grandson\"]}]\n (= (__ progeny)\n #{[\"father\" \"son\"] [\"father\" \"grandson\"]\n [\"uncle\" \"cousin\"] [\"son\" \"grandson\"]}))"],
:times-solved 57,
:title "Transitive Closure",
:user "dbyrne"}