File tree 2 files changed +13
-0
lines changed
2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 8
8
(require "reverse-integer.rkt " )
9
9
(require "length-of-last-word.rkt " )
10
10
(require "first-missing-positive.rkt " )
11
+ (require "num-is-palindrome.rkt " )
11
12
12
13
(check-equal? (two-sum 5 '(1 2 3 4 )) '(1 2 ))
13
14
(check-equal? (two-sum 21 '(0 2 11 19 90 )) '(1 3 ))
35
36
(check-equal? (first-missing-positive '(1 2 0 )) 3 )
36
37
(check-equal? (first-missing-positive '(3 4 -1 1 )) 2 )
37
38
(check-equal? (first-missing-positive '(7 8 9 11 12 )) 1 )
39
+
40
+ (check-equal? (num-is-palindrome 121 ) #t )
41
+ (check-equal? (num-is-palindrome -121 ) #f )
42
+ (check-equal? (num-is-palindrome 10 ) #f )
Original file line number Diff line number Diff line change
1
+ #lang racket
2
+
3
+ (define (num-is-palindrome num)
4
+ "https://leetcode.com/problems/palindrome-number/ "
5
+ (define num-list (string->list (number->string num)))
6
+ (equal? (reverse num-list) num-list))
7
+
8
+ (provide num-is-palindrome)
You can’t perform that action at this time.
0 commit comments