summaryrefslogtreecommitdiff
path: root/prolog/problems/lists/count_3/common.py
blob: 8a85079004694dc35b89070560d795ba5b284466 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# coding=utf-8

id = 120
number = 27
visible = True
facts = None

solution = '''\
count(_, [], 0).
count(X, [X|T], N) :-
  count(X, T, NT),
  N is NT + 1.
count(X, [Y|T], NT) :-
  X \== Y,
  count(X, T, NT).
'''