Skip to content

Commit

Permalink
Fix 016 to also check upper chars
Browse files Browse the repository at this point in the history
  • Loading branch information
WeetHet committed Sep 18, 2024
1 parent 197aca2 commit f67ed37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 016-count_distinct_characters.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ function contains_char(s: string, c: char): bool
requires forall i :: 0 <= i < |s| ==> 'a' <= s[i] <= 'z' || 'A' <= s[i] <= 'Z'
requires 'a' <= c <= 'z'
{
if |s| == 0 then false else s[0] == c || contains_char(s[1..], c)
if |s| == 0 then false else s[0] == c || s[0] == upper_char(c) || contains_char(s[1..], c)
}

function upper_char(c: char) : (C: char)
Expand Down

0 comments on commit f67ed37

Please sign in to comment.