File tree 1 file changed +46
-12
lines changed
src/interview-classics/is-palindrome
1 file changed +46
-12
lines changed Original file line number Diff line number Diff line change 1
1
# Is Palindrome
2
2
3
- Create a function named isPalindrome that takes a string as an input, outputs
4
- true if the string is a palindrome, or false otherwise.
5
-
6
- Ignore the following characters
7
-
8
- - Whitespace
9
- - .
10
- - ,
11
- - :
12
- - ;
13
- - ?
14
- - !
3
+ Write a function ` isPalindrome ` that takes a string as input, and returns
4
+ whether the string is a palindrome.
5
+
6
+ Punctuation is ignored when validating a palindrome. You only need to consider
7
+ the following punctuation characters:
8
+
9
+ ```
10
+ - . , : ; ? ! ' "
11
+ ```
12
+
13
+ White space is also ignored when validating a palindrome. You only need to
14
+ consider the followihg whitespace characters for this exercise
15
+
16
+ * ` space `
17
+ * ` tab `
18
+ * ` new line `
19
+
20
+ ## Function Signagure
21
+
22
+ ``` typescript
23
+ function isPalindrome(str : string ): boolean
24
+ ```
25
+
26
+ ## Expected Behavior
27
+
28
+ ```
29
+ In: ''
30
+ Out: true
31
+
32
+ In: 'x'
33
+ Out: true
34
+
35
+ In: 'xy'
36
+ Out: false
37
+
38
+ In: '1230321'
39
+ Out: true
40
+
41
+ In: '1230123'
42
+ Out: false
43
+
44
+ In: ' a: \nbc. c!-ba? "'
45
+ Out: true
46
+ ```
47
+
48
+ ## Optimizations
You can’t perform that action at this time.
0 commit comments