You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I really like your solution, but could not get it running on windows.
\r\n is not supported and can not easily be implemented as the split requires one char only
\r\n or \n can be at the end of the file, this breaks the logic.
I solved it like this:
// let d = include_bytes!("../input.txt");
let mut d_without_cr: Vec<u8> = input.into();
if d_without_cr.contains(&b'\r') {
d_without_cr.retain_mut(|it| *it != b'\r');
};
if d_without_cr.last().unwrap() == &b'\n' {
d_without_cr.pop();
}
let d = &d_without_cr[..];
I did not want to fork as this of course has a performance impact.
But might be worse mentioning in case any other later comers like me take a look :)
Best,
G.
The text was updated successfully, but these errors were encountered:
I really like your solution, but could not get it running on windows.
I solved it like this:
I did not want to fork as this of course has a performance impact.
But might be worse mentioning in case any other later comers like me take a look :)
Best,
G.
The text was updated successfully, but these errors were encountered: