commit e8bc10fd75cf08704c7f1ed7bdf4424d5fa45203 Author: Rokas Puzonas Date: Thu May 11 22:33:32 2023 +0300 initial commit diff --git a/551.cpp b/551.cpp new file mode 100644 index 0000000..2865ce1 --- /dev/null +++ b/551.cpp @@ -0,0 +1,31 @@ +#include +#include +using namespace std; + +class Solution +{ +public: + bool checkRecord(string s) + { + int absent_count = 0; + for (int i = 0; i < s.length(); i++) + { + absent_count += (s[i] == 'A'); + if (absent_count > 1) + return false; + } + for (int i = 0; i < (int)s.length() - 2; i++) + { + // cout< +#include + +using namespace std; + +class Solution +{ +public: + int sum(vector &A) + { + int sum = 0; + for (int i = 0; i < A.size(); i++) + sum += A[i]; + return sum; + } + + vector fairCandySwap(vector &A, vector &B) + { + int diff = (sum(A) - sum(B))/2; + cout<{A[i], B[j]}; + return vector{0, 0}; + } +}; + +void outputVector(vector A) +{ + for (int i = 0; i < A.size(); i++) + cout< A = {2}; + vector B = {1, 3}; + Solution solution = Solution(); + outputVector(solution.fairCandySwap(A, B)); + return 0; +} diff --git a/makefile b/makefile new file mode 100644 index 0000000..e2ff618 --- /dev/null +++ b/makefile @@ -0,0 +1,5 @@ +CXX = g++ +#ls -d * | entr sh -c "make main && ./main" + +%: %.cpp + $(CXX) -o $@ $<