Skip to content

Instantly share code, notes, and snippets.

@juanfal
juanfal / t10e24.rom2int.cpp
Last active Jan 16, 2022
roman numbers value
View t10e24.rom2int.cpp
// t10e24.rom2int.cpp
// juanfc 2022-01-16
// https://gist.github.com/f47e281ad205395051fd1aaf8f0aa13a
#include <iostream>
using namespace std;
void test(string s);
int main()
View t10e23.lookandsay.cpp
// t10e23.lookandsay.cpp
// juanfc 2022-01-16
//
#include <iostream>
using namespace std;
string lookandsay(string s);
int main()
View t10e22.wordpattern.cpp
// t10e22.wordpattern.cpp
// juanfc 2022-01-16
//
#include <iostream>
using namespace std;
void test(string s1, string s2);
View t10e22.hamming.cpp
// t10e22.hamming.cpp
// juanfc 2022-01-16
//
#include <iostream>
using namespace std;
void test(string s1, string s2);
View t10e21.rgbtohex.cpp
// t10e21.rgbtohex.cpp
// juanfc 2022-01-16
//
#include <iostream>
#include <array>
using namespace std;
typedef array<int,3> TRGB;
View t10e20.isvalidean.cpp
// t10e20.isvalidean.cpp
// juanfc 2022-01-16
//
#include <iostream>
using namespace std;
void test(string s);
int main()
View t10e19.validbraces.cpp
// t10e19.validbraces.cpp
// juanfc 2022-01-15
//
#include <iostream>
using namespace std;
const string OPENING = "([{<“‘";
const string CLOSING = ")]}>”’";
@juanfal
juanfal / t10e18.nextPiece.cpp
Created Jan 15, 2022
split and get next piece
View t10e18.nextPiece.cpp
// t10e18.nextPiece.cpp
// juanfc 2022-01-15
//
#include <iostream>
using namespace std;
string nextPiece(string s, char sep='\0');
int main()
View t10e18.stringglobsearch.cpp
// t10e18.stringglobsearch.cpp
// juanfc 2022-01-14
//
#include <iostream>
using namespace std;
int find(string s, string ss, int from=0);
int main()
View t10e16.stringdiff.cpp
// t10e16.stringdiff.cpp
// juanfc 2022-01-14
//
#include <iostream>
#include <array>
using namespace std;
string diff(string a, string b);