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

id = 112
number = 19
visible = True
facts = None

solution = '''\
conc112([], L, L).
conc112([H|T], L2, [H|L]) :-
  conc112(T, L2, L).
rev112([], []).
rev112([H|T], R):-
  rev112(T, R1),
  conc112(R1, [H], R).
palindrome(L) :-
  rev112(L, L).
'''