Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Codechef/DEC19B/binadd.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include<bits/stdc++.h>
using namespace std;

std::bitset<10000> to_bitset(std::string s)
bitset<10000> to_bitset(string s)
{
auto binary = [](char c) { return c == '0' || c == '1'; };
auto not_binary = [binary](char c) { return !binary(c); };

s.erase(std::remove_if(begin(s), end(s), not_binary), end(s));
s.erase(remove_if(begin(s), end(s), not_binary), end(s));

return std::bitset<10000>(s);
}
Expand Down Expand Up @@ -50,4 +50,4 @@ using namespace std;
}

return 0;
}
}