Skip to content

Commit

Permalink
Check if prev. and next are alphanumeric
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNeshi authored Nov 18, 2024
1 parent 5f31d61 commit 55de0ef
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions exercises/practice/word-count/.meta/example.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,7 @@ fn split_phrase_into_words(phrase: ByteArray) -> Array<ByteArray> {
if is_alphanumeric_or_apostrophe(lower_case) {
if !is_apostrophe(lower_case)
|| (i > 0 && i < phrase.len()
- 1
&& is_alphanumeric_or_apostrophe(phrase[i - 1])
&& is_alphanumeric_or_apostrophe(phrase[i + 1])) {
- 1 && is_alphanumeric(phrase[i - 1]) && is_alphanumeric(phrase[i + 1])) {
current_word.append_byte(lower_case);
}
} else if current_word.len() > 0 {
Expand Down

0 comments on commit 55de0ef

Please sign in to comment.