File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 88(require "reverse-integer.rkt " )
99(require "length-of-last-word.rkt " )
1010(require "first-missing-positive.rkt " )
11+ (require "num-is-palindrome.rkt " )
1112
1213(check-equal? (two-sum 5 '(1 2 3 4 )) '(1 2 ))
1314(check-equal? (two-sum 21 '(0 2 11 19 90 )) '(1 3 ))
3536(check-equal? (first-missing-positive '(1 2 0 )) 3 )
3637(check-equal? (first-missing-positive '(3 4 -1 1 )) 2 )
3738(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