-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
#include <string>
#include <vector>
using namespace std;
vector<int> solution(int brown, int yellow) {
vector<int> answer;
int totalSize = brown + yellow;
for (int i = 3; i < totalSize / 2; i++) {
if (totalSize % i != 0)
continue;
int width = i;
int heigth = totalSize / i;
if (width * 2 + heigth * 2 - 4 == brown) {
answer.push_back(max(width, heigth));
answer.push_back(min(width, heigth));
break;
}
}
return answer;
}Metadata
Metadata
Assignees
Labels
Projects
Status
Done