Skip to content

Commit b3a54a8

Browse files
committed
Removing palindrome occurence by counting
1 parent 30f25dc commit b3a54a8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

1332/main.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
impl Solution {
2+
pub fn remove_palindrome_sub(s: String) -> i32 {
3+
if s.len() == 0 {
4+
return 0;
5+
}
6+
let new_string = s.clone().chars().rev().collect::<String>();
7+
if s == new_string {
8+
return 1;
9+
}
10+
2
11+
}
12+
}

0 commit comments

Comments
 (0)