Skip to main content

library_checker/string/
wildcard_pattern_matching.rs

1use competitive::prelude::*;
2use competitive::string::wildcard_pattern_matching as wildcard_pattern_matching_library;
3
4#[verify::library_checker("wildcard_pattern_matching")]
5pub fn wildcard_pattern_matching(reader: impl Read, writer: impl Write) {
6    prepare_io!(reader, writer);
7    sc!(mut s: Bytes, mut t: Bytes);
8    for c in s.iter_mut().chain(t.iter_mut()) {
9        if *c == b'*' {
10            *c = b'?';
11        }
12    }
13    let ans = wildcard_pattern_matching_library(&t, &s);
14    pp!(@ns @bw (b'0' ans));
15}