From 8e443241468f7df783acb5c255de49169157a938 Mon Sep 17 00:00:00 2001 From: Adam French Date: Sun, 20 Sep 2026 23:31:20 +0100 Subject: [PATCH] new problems --- solving/largest-rectangle-in-histogram/.url | 1 + .../histogram.in | 0 .../largest-rectangle-in-histogram/main.cpp | 106 ++++++++++++ .../largest-rectangle-in-histogram/tests/1.in | 1 + .../largest-rectangle-in-histogram/tests/2.in | 1 + solving/longest-common-subsequence/.url | 1 + .../longest-common-subsequence.in | 0 solving/longest-common-subsequence/main.cpp | 89 ++++++++++ solving/longest-common-subsequence/tests/1.in | 2 + solving/longest-common-subsequence/tests/2.in | 2 + solving/longest-common-subsequence/tests/3.in | 2 + solving/lru-cache/.url | 1 + solving/lru-cache/lru-cache.in | 0 solving/lru-cache/main.cpp | 85 +++++++++ solving/minimum-window-substring/.url | 1 + solving/minimum-window-substring/main.cpp | 163 ++++++++++++++++++ .../minimum-window-substring.in | 0 solving/minimum-window-substring/tests/1.in | 2 + solving/minimum-window-substring/tests/2.in | 2 + solving/minimum-window-substring/tests/3.in | 2 + solving/minimum-window-substring/tests/4.in | 2 + solving/number-of-atoms/.url | 1 + solving/number-of-atoms/main.cpp | 114 ++++++++++++ solving/number-of-atoms/number-of-atoms.in | 0 solving/number-of-atoms/tests/1.in | 1 + solving/number-of-atoms/tests/2.in | 1 + solving/number-of-atoms/tests/3.in | 1 + 27 files changed, 581 insertions(+) create mode 100644 solving/largest-rectangle-in-histogram/.url create mode 100644 solving/largest-rectangle-in-histogram/histogram.in create mode 100644 solving/largest-rectangle-in-histogram/main.cpp create mode 100644 solving/largest-rectangle-in-histogram/tests/1.in create mode 100644 solving/largest-rectangle-in-histogram/tests/2.in create mode 100644 solving/longest-common-subsequence/.url create mode 100644 solving/longest-common-subsequence/longest-common-subsequence.in create mode 100644 solving/longest-common-subsequence/main.cpp create mode 100644 solving/longest-common-subsequence/tests/1.in create mode 100644 solving/longest-common-subsequence/tests/2.in create mode 100644 solving/longest-common-subsequence/tests/3.in create mode 100644 solving/lru-cache/.url create mode 100644 solving/lru-cache/lru-cache.in create mode 100644 solving/lru-cache/main.cpp create mode 100644 solving/minimum-window-substring/.url create mode 100644 solving/minimum-window-substring/main.cpp create mode 100644 solving/minimum-window-substring/minimum-window-substring.in create mode 100644 solving/minimum-window-substring/tests/1.in create mode 100644 solving/minimum-window-substring/tests/2.in create mode 100644 solving/minimum-window-substring/tests/3.in create mode 100644 solving/minimum-window-substring/tests/4.in create mode 100644 solving/number-of-atoms/.url create mode 100644 solving/number-of-atoms/main.cpp create mode 100644 solving/number-of-atoms/number-of-atoms.in create mode 100644 solving/number-of-atoms/tests/1.in create mode 100644 solving/number-of-atoms/tests/2.in create mode 100644 solving/number-of-atoms/tests/3.in diff --git a/solving/largest-rectangle-in-histogram/.url b/solving/largest-rectangle-in-histogram/.url new file mode 100644 index 0000000..adb2e84 --- /dev/null +++ b/solving/largest-rectangle-in-histogram/.url @@ -0,0 +1 @@ +https://leetcode.com/problems/largest-rectangle-in-histogram/description/?envType=problem-list-v2&envId=22fmu8yh diff --git a/solving/largest-rectangle-in-histogram/histogram.in b/solving/largest-rectangle-in-histogram/histogram.in new file mode 100644 index 0000000..e69de29 diff --git a/solving/largest-rectangle-in-histogram/main.cpp b/solving/largest-rectangle-in-histogram/main.cpp new file mode 100644 index 0000000..ec5253e --- /dev/null +++ b/solving/largest-rectangle-in-histogram/main.cpp @@ -0,0 +1,106 @@ +#include +#include +#include +#include +#include +#include +using namespace std; + +// ----- TYPES ----- +typedef long long ll; +typedef pair pii; +typedef vector vi; + +// ----- FILE IO ----- +#define STDIN(filename) freopen(filename, "r", stdin) +#define STDOUT(filename) freopen(filename, "w", stdout) +#define FASTIO cin.tie(0)->sync_with_stdio(0) +#define STDIO(filename) FASTIO; string filenamee(filename); STDIN((filenamee + ".in").c_str()); STDOUT((filenamee + ".out").c_str()) +#define NL '\n' +#define CM ", " + +// ----- FOR LOOPS ----- +#define F(i,L,R) for (int i = L; i < R; i++) +#define FE(i,L,R) for (int i = L; i <= R; i++) +#define FD(i,L,R) for (int i = L; i > R; i--) +#define FDE(i,L,R) for (int i = L; i >= R; i--) + +// ----- WEZ ----- +#define takeI(n) int n; cin >> n +#define takeII(n,m) int n, m; cin >> n >> m +#define takeIII(n,m,k) int n, m, k; cin >> n >> m >> k +#define takeL(n) ll n; cin >> n +#define takeS(s) string s; cin >> s +#define takeV(v,n) vi v(n); for (auto &x : v) cin >> x +#define takeVL(v,n) vector v(n); for (auto &x : v) cin >> x +#define whileZ takeI(T); while(T--) +// +// ----- MAX MIN ----- +#define REMAX(a,b) (a)=max((a),(b)) +#define REMIN(a,b) (a)=min((a),(b)) + +// ----- PAIRS ----- +#define fi first +#define se second + +// ----- OUTPUT ----- +#define YESNO(b) cout << ((b) ? "YES" : "NO") << NL + +// ----- DEBUG ----- +#define DBG(vari) cerr<<#vari<<" = "<<(vari)<()) +#define UNIQ(c) SORT(c), (c).erase(unique(ALL(c)), (c).end()) +#define pb push_back + +int main() { + STDIO("histogram"); + + // [1,2,3,4] + string s; getline(cin, s); + for (char &c : s) if (!isdigit(c) && c != '-') c = ' '; + stringstream ss(s); vector h; int x; + while (ss >> x) h.push_back(x); + + int n = h.size(); + stack> stk; + vector left(n), right(n); + + F(i,0,n) { + int l = i; + while (!stk.empty() && stk.top().first > h[i]) { + l = stk.top().second; + stk.pop(); + } + if (l != i) l = left[l]; + left[i] = l; + stk.push({h[i], i}); + } + + FDE(i,n-1,0) { + int r = i; + while (!stk.empty() && stk.top().first > h[i]) { + r = stk.top().second; + stk.pop(); + } + if (r != i) r = right[r]; + right[i] = r; + stk.push({h[i], i}); + } + + int res = 0; + F(i,0,n) { + int width = (right[i] - left[i] + 1); + int new_res = width * h[i]; + REMAX(res, new_res); + } + + cout << res; +} diff --git a/solving/largest-rectangle-in-histogram/tests/1.in b/solving/largest-rectangle-in-histogram/tests/1.in new file mode 100644 index 0000000..cbe7ea0 --- /dev/null +++ b/solving/largest-rectangle-in-histogram/tests/1.in @@ -0,0 +1 @@ +[2,4] diff --git a/solving/largest-rectangle-in-histogram/tests/2.in b/solving/largest-rectangle-in-histogram/tests/2.in new file mode 100644 index 0000000..8c8b02a --- /dev/null +++ b/solving/largest-rectangle-in-histogram/tests/2.in @@ -0,0 +1 @@ +[2,1,5,6,2,3] diff --git a/solving/longest-common-subsequence/.url b/solving/longest-common-subsequence/.url new file mode 100644 index 0000000..e56f8b9 --- /dev/null +++ b/solving/longest-common-subsequence/.url @@ -0,0 +1 @@ +https://leetcode.com/problems/longest-common-subsequence/?envType=problem-list-v2&envId=oizxjoit diff --git a/solving/longest-common-subsequence/longest-common-subsequence.in b/solving/longest-common-subsequence/longest-common-subsequence.in new file mode 100644 index 0000000..e69de29 diff --git a/solving/longest-common-subsequence/main.cpp b/solving/longest-common-subsequence/main.cpp new file mode 100644 index 0000000..0f32e34 --- /dev/null +++ b/solving/longest-common-subsequence/main.cpp @@ -0,0 +1,89 @@ +#include +#include +#include +#include +using namespace std; + +// ----- TYPES ----- +typedef long long ll; +typedef pair pii; +typedef vector vi; + +// ----- FILE IO ----- +#define STDIN(filename) freopen(filename, "r", stdin) +#define STDOUT(filename) freopen(filename, "w", stdout) +#define FASTIO cin.tie(0)->sync_with_stdio(0) +#define STDIO(filename) FASTIO; string filenamee(filename); STDIN((filenamee + ".in").c_str()); STDOUT((filenamee + ".out").c_str()) +#define NL '\n' +#define CM ", " + +// ----- FOR LOOPS ----- +#define F(i,L,R) for (int i = L; i < R; i++) +#define FE(i,L,R) for (int i = L; i <= R; i++) +#define FD(i,L,R) for (int i = L; i > R; i--) +#define FDE(i,L,R) for (int i = L; i >= R; i--) + +// ----- WEZ ----- +#define takeI(n) int n; cin >> n +#define takeII(n,m) int n, m; cin >> n >> m +#define takeIII(n,m,k) int n, m, k; cin >> n >> m >> k +#define takeL(n) ll n; cin >> n +#define takeS(s) string s; cin >> s +#define takeV(v,n) vi v(n); for (auto &x : v) cin >> x +#define takeVL(v,n) vector v(n); for (auto &x : v) cin >> x +#define whileZ takeI(T); while(T--) +// +// ----- MAX MIN ----- +#define REMAX(a,b) (a)=max((a),(b)) +#define REMIN(a,b) (a)=min((a),(b)) + +// ----- PAIRS ----- +#define fi first +#define se second + +// ----- OUTPUT ----- +#define YESNO(b) cout << ((b) ? "YES" : "NO") << NL + +// ----- DEBUG ----- +#define DBG(vari) cerr<<#vari<<" = "<<(vari)<()) +#define UNIQ(c) SORT(c), (c).erase(unique(ALL(c)), (c).end()) +#define pb push_back + +int main() { + STDIO("longest-common-subsequence"); + takeS(s1); + takeS(s2); + + int n = s1.size(), m = s2.size(); + vector> dp(m, vector(n)); + + dp[0][0] = s1[0] == s2[0] ? 1 : 0; + F(i,1,n) { + dp[0][i] = max(dp[0][i-1], s1[i] == s2[0] ? 1 : 0); + } + F(j,1,m) { + dp[j][0] = max(dp[j-1][0], s1[0] == s2[j] ? 1 : 0); + } + + F(i,1,n) { + F(j,1,m) { + if (s1[i] == s2[j]) { + dp[j][i] = dp[j-1][i-1] + 1; + } else { + dp[j][i] = max(dp[j-1][i], dp[j][i-1]); + } + } + } + + + cout << dp[m-1][n-1]; +} diff --git a/solving/longest-common-subsequence/tests/1.in b/solving/longest-common-subsequence/tests/1.in new file mode 100644 index 0000000..4eaa6e5 --- /dev/null +++ b/solving/longest-common-subsequence/tests/1.in @@ -0,0 +1,2 @@ +abcde +ace diff --git a/solving/longest-common-subsequence/tests/2.in b/solving/longest-common-subsequence/tests/2.in new file mode 100644 index 0000000..5d8a556 --- /dev/null +++ b/solving/longest-common-subsequence/tests/2.in @@ -0,0 +1,2 @@ +abc +abc diff --git a/solving/longest-common-subsequence/tests/3.in b/solving/longest-common-subsequence/tests/3.in new file mode 100644 index 0000000..5f5521f --- /dev/null +++ b/solving/longest-common-subsequence/tests/3.in @@ -0,0 +1,2 @@ +abc +def diff --git a/solving/lru-cache/.url b/solving/lru-cache/.url new file mode 100644 index 0000000..36de0d3 --- /dev/null +++ b/solving/lru-cache/.url @@ -0,0 +1 @@ +https://leetcode.com/problems/lru-cache/?envType=problem-list-v2&envId=22fmu8yh diff --git a/solving/lru-cache/lru-cache.in b/solving/lru-cache/lru-cache.in new file mode 100644 index 0000000..e69de29 diff --git a/solving/lru-cache/main.cpp b/solving/lru-cache/main.cpp new file mode 100644 index 0000000..b1777ac --- /dev/null +++ b/solving/lru-cache/main.cpp @@ -0,0 +1,85 @@ +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +// ----- TYPES ----- +typedef long long ll; +typedef pair pii; +typedef vector vi; + +// ----- FILE IO ----- +#define STDIN(filename) freopen(filename, "r", stdin) +#define STDOUT(filename) freopen(filename, "w", stdout) +#define FASTIO cin.tie(0)->sync_with_stdio(0) +#define STDIO(filename) FASTIO; string filenamee(filename); STDIN((filenamee + ".in").c_str()); STDOUT((filenamee + ".out").c_str()) +#define NL '\n' +#define CM ", " + +// ----- FOR LOOPS ----- +#define F(i,L,R) for (int i = L; i < R; i++) +#define FE(i,L,R) for (int i = L; i <= R; i++) +#define FD(i,L,R) for (int i = L; i > R; i--) +#define FDE(i,L,R) for (int i = L; i >= R; i--) + +// ----- WEZ ----- +#define takeI(n) int n; cin >> n +#define takeII(n,m) int n, m; cin >> n >> m +#define takeIII(n,m,k) int n, m, k; cin >> n >> m >> k +#define takeL(n) ll n; cin >> n +#define takeS(s) string s; cin >> s +#define takeV(v,n) vi v(n); for (auto &x : v) cin >> x +#define takeVL(v,n) vector v(n); for (auto &x : v) cin >> x +#define whileZ takeI(T); while(T--) +// +// ----- MAX MIN ----- +#define REMAX(a,b) (a)=max((a),(b)) +#define REMIN(a,b) (a)=min((a),(b)) + +// ----- PAIRS ----- +#define fi first +#define se second + +// ----- OUTPUT ----- +#define YESNO(b) cout << ((b) ? "YES" : "NO") << NL + +// ----- DEBUG ----- +#define DBG(vari) cerr<<#vari<<" = "<<(vari)<()) +#define UNIQ(c) SORT(c), (c).erase(unique(ALL(c)), (c).end()) +#define pb push_back + +// struct LRU_Node { +// int key; +// int val; +// LRU_Node* prev; +// LRU_Node* next; +// }; +// +// class LRU_Cache { +// public: +// LRU_Node* tail; +// LRU_Node* head; +// } + +int main() { + FASTIO; + list lst; + unordered_map::iterator> mp; + lst.push_back(3); + mp[2] = lst.end()--; + auto it = mp.find(2); + cout << *it->second << NL; +} diff --git a/solving/minimum-window-substring/.url b/solving/minimum-window-substring/.url new file mode 100644 index 0000000..111ab6f --- /dev/null +++ b/solving/minimum-window-substring/.url @@ -0,0 +1 @@ +https://leetcode.com/problems/minimum-window-substring/?envType=problem-list-v2&envId=oizxjoit diff --git a/solving/minimum-window-substring/main.cpp b/solving/minimum-window-substring/main.cpp new file mode 100644 index 0000000..f6d453e --- /dev/null +++ b/solving/minimum-window-substring/main.cpp @@ -0,0 +1,163 @@ +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +// ----- TYPES ----- +typedef long long ll; +typedef pair pii; +typedef vector vi; + +// ----- FILE IO ----- +#define STDIN(filename) freopen(filename, "r", stdin) +#define STDOUT(filename) freopen(filename, "w", stdout) +#define FASTIO cin.tie(0)->sync_with_stdio(0) +#define STDIO(filename) FASTIO; string filenamee(filename); STDIN((filenamee + ".in").c_str()); STDOUT((filenamee + ".out").c_str()) +#define NL '\n' +#define CM ", " + +// ----- FOR LOOPS ----- +#define F(i,L,R) for (int i = L; i < R; i++) +#define FE(i,L,R) for (int i = L; i <= R; i++) +#define FD(i,L,R) for (int i = L; i > R; i--) +#define FDE(i,L,R) for (int i = L; i >= R; i--) + +// ----- WEZ ----- +#define takeI(n) int n; cin >> n +#define takeII(n,m) int n, m; cin >> n >> m +#define takeIII(n,m,k) int n, m, k; cin >> n >> m >> k +#define takeL(n) ll n; cin >> n +#define takeS(s) string s; cin >> s +#define takeV(v,n) vi v(n); for (auto &x : v) cin >> x +#define takeVL(v,n) vector v(n); for (auto &x : v) cin >> x +#define whileZ takeI(T); while(T--) +// +// ----- MAX MIN ----- +#define REMAX(a,b) (a)=max((a),(b)) +#define REMIN(a,b) (a)=min((a),(b)) + +// ----- PAIRS ----- +#define fi first +#define se second + +// ----- OUTPUT ----- +#define YESNO(b) cout << ((b) ? "YES" : "NO") << NL + +// ----- DEBUG ----- +#define DBG(vari) cerr<<#vari<<" = "<<(vari)<()) +#define UNIQ(c) SORT(c), (c).erase(unique(ALL(c)), (c).end()) +#define pb push_back + +struct condoms { + int x; +}; + +int main() { + STDIO("minimum-window-substring"); + takeS(s); + takeS(t); + + // If t has more chars than s, s cannot possibly have all chars of t + if (t.size() > s.size() || t.size() == 0) { + cout << "" << NL; + return 0; + } + queue tst; + tst.push(2); + condoms* condom = new condoms; + stack stk({condom}); + tst.front(); + stk.pop(); + + + stringstream ss; + + // winTCount tells us how many chars of t we have in our window + int winTCount = 0; + // Use tFreq to count frequency of chars in t + // winFreq is frequency of (important) chars in window + unordered_map tFreq, winFreq; + for (const char& x : t) tFreq[x]++; + + // Find l, the first s[l] that occurs in t + int l = 0; + for (; l < s.size(); l++) { + if (tFreq.count(s[l])) { + winFreq[s[l]]++; + winTCount++; + break; + } + } + + // Check if OOB + if (l == s.size()) { + cout << "" << NL; + return 0; + } + + // Find r, the substr s[l...r] that satisfies min window criteria + int r = l; + if (t.size() > 1) { + for (r=l+1; r < s.size(); r++) { + if (tFreq.count(s[r]) && winFreq[s[r]] < tFreq[s[r]]) { + winFreq[s[r]]++; + winTCount++; + } + if (winTCount == t.size()) break; + } + } + + // Check if OOB + if (r == s.size()) { + if (winTCount == t.size()) { + cout << s; + } else { + cout << "" << NL; + } + return 0; + } + + int best_len = r-l+1, best_l = l, best_r = r; + DBG(s.substr(best_l, best_r-best_l+1)); + // Keep moving window until invalid + while (r < s.size()) { + // Remove s[l], we will need to increase r until we find s[l] again + char desire = s[l]; + // Move l to next char occuring in t + l++; + while (l < s.size() && !tFreq.count(s[l])) l++; + // Move r until we find 'desire' again + r++; + while (r < s.size() && s[r] != desire) r++; + + if (r >= s.size() || l >= s.size()) break; + + DBG(desire); + cerr << s.substr(l, r-l+1) << NL; + int len = r - l + 1; + if (len <= best_len) { + best_len = len; + best_l = l; + best_r = r; + } + } + + DBG(s); + DBG(t); + cout << s.substr(best_l, best_r-best_l+1) << NL; + return 0; +} diff --git a/solving/minimum-window-substring/minimum-window-substring.in b/solving/minimum-window-substring/minimum-window-substring.in new file mode 100644 index 0000000..e69de29 diff --git a/solving/minimum-window-substring/tests/1.in b/solving/minimum-window-substring/tests/1.in new file mode 100644 index 0000000..d18226f --- /dev/null +++ b/solving/minimum-window-substring/tests/1.in @@ -0,0 +1,2 @@ +ADOBECODEBANC +AABC diff --git a/solving/minimum-window-substring/tests/2.in b/solving/minimum-window-substring/tests/2.in new file mode 100644 index 0000000..7e8a165 --- /dev/null +++ b/solving/minimum-window-substring/tests/2.in @@ -0,0 +1,2 @@ +a +a diff --git a/solving/minimum-window-substring/tests/3.in b/solving/minimum-window-substring/tests/3.in new file mode 100644 index 0000000..204dd92 --- /dev/null +++ b/solving/minimum-window-substring/tests/3.in @@ -0,0 +1,2 @@ +a +aa diff --git a/solving/minimum-window-substring/tests/4.in b/solving/minimum-window-substring/tests/4.in new file mode 100644 index 0000000..3b825e7 --- /dev/null +++ b/solving/minimum-window-substring/tests/4.in @@ -0,0 +1,2 @@ +ADOBECODEBANC +ABC diff --git a/solving/number-of-atoms/.url b/solving/number-of-atoms/.url new file mode 100644 index 0000000..4ef45cc --- /dev/null +++ b/solving/number-of-atoms/.url @@ -0,0 +1 @@ +https://leetcode.com/problems/number-of-atoms/description/\?envType\=problem-list-v2\&envId\=dfh05knr diff --git a/solving/number-of-atoms/main.cpp b/solving/number-of-atoms/main.cpp new file mode 100644 index 0000000..9d8d908 --- /dev/null +++ b/solving/number-of-atoms/main.cpp @@ -0,0 +1,114 @@ +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +// ----- TYPES ----- +typedef long long ll; +typedef pair pii; +typedef vector vi; + +// ----- FILE IO ----- +#define STDIN(filename) freopen(filename, "r", stdin) +#define STDOUT(filename) freopen(filename, "w", stdout) +#define FASTIO cin.tie(0)->sync_with_stdio(0) +#define STDIO(filename) FASTIO; string filenamee(filename); STDIN((filenamee + ".in").c_str()); STDOUT((filenamee + ".out").c_str()) +#define NL '\n' +#define CM ", " + +// ----- FOR LOOPS ----- +#define F(i,L,R) for (int i = L; i < R; i++) +#define FE(i,L,R) for (int i = L; i <= R; i++) +#define FD(i,L,R) for (int i = L; i > R; i--) +#define FDE(i,L,R) for (int i = L; i >= R; i--) + +// ----- WEZ ----- +#define takeI(n) int n; cin >> n +#define takeII(n,m) int n, m; cin >> n >> m +#define takeIII(n,m,k) int n, m, k; cin >> n >> m >> k +#define takeL(n) ll n; cin >> n +#define takeS(s) string s; cin >> s +#define takeV(v,n) vi v(n); for (auto &x : v) cin >> x +#define takeVL(v,n) vector v(n); for (auto &x : v) cin >> x +#define whileZ takeI(T); while(T--) +// +// ----- MAX MIN ----- +#define REMAX(a,b) (a)=max((a),(b)) +#define REMIN(a,b) (a)=min((a),(b)) + +// ----- PAIRS ----- +#define fi first +#define se second + +// ----- OUTPUT ----- +#define YESNO(b) cout << ((b) ? "YES" : "NO") << NL + +// ----- DEBUG ----- +#define DBG(vari) cerr<<#vari<<" = "<<(vari)<()) +#define UNIQ(c) SORT(c), (c).erase(unique(ALL(c)), (c).end()) +#define pb push_back + +string print_uomap(const map& mp) { + stringstream ss; + for (const auto& [key, val] : mp) { + ss << key; + if (val > 1) ss << val; + } + return ss.str(); +} + +int main() { + STDIO("number-of-atoms"); + string formula; + cin >> formula; + + stringstream ss(formula); + + stack> stk; + stk.push({}); + + char ch; + while (ss >> ch) { + if (ch == '(') { + stk.push({}); + } else if (ch == ')') { + int mult = 1; + if (isdigit(ss.peek())) ss >> mult; + auto old = stk.top(); stk.pop(); + auto& nw = stk.top(); + for (auto& [key, val] : old) { + nw[key] += val * mult; + } + } + else /** isElement */ { + string elem; + int mult = 1; + elem += ch; + while (islower(ss.peek())) { + ss >> ch; + elem += ch; + } + if (isdigit(ss.peek())) { + ss >> mult; + } + stk.top()[elem] += mult; + } + } + + + print_uomap(stk.top()); + return 0; +} diff --git a/solving/number-of-atoms/number-of-atoms.in b/solving/number-of-atoms/number-of-atoms.in new file mode 100644 index 0000000..e69de29 diff --git a/solving/number-of-atoms/tests/1.in b/solving/number-of-atoms/tests/1.in new file mode 100644 index 0000000..fdf0ff5 --- /dev/null +++ b/solving/number-of-atoms/tests/1.in @@ -0,0 +1 @@ +H2O diff --git a/solving/number-of-atoms/tests/2.in b/solving/number-of-atoms/tests/2.in new file mode 100644 index 0000000..fec1ef4 --- /dev/null +++ b/solving/number-of-atoms/tests/2.in @@ -0,0 +1 @@ +Mg(OH)2 diff --git a/solving/number-of-atoms/tests/3.in b/solving/number-of-atoms/tests/3.in new file mode 100644 index 0000000..96cfe76 --- /dev/null +++ b/solving/number-of-atoms/tests/3.in @@ -0,0 +1 @@ +K4(ON(SO3)2)2