codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
#include <iostream> #include <string> #include <algorithm> bool check(std::string first, std::string two); int main() { std::cout << (check("hello", "loll") ? "True" : "False") << std::endl; return 0; } bool check(std::string first, std::string two) { for(size_t i = 0; i < two.length(); ++i) if(first.find(two.at(i)) == std::string::npos) return false; else first[i] = '0'; //black magic. return true; }
Private
[
?
]
Run code
Submit