for (int first = 0; first < 12; first++) {
for (int second = 0; second < 12; second++) {
if (second == first) {
continue;
}
for (int third = 0; third < 12; third++) {
if (third == second || third == first) {
continue;
}
for (int fourth = 0; fourth < 12; fourth++) {
if (fourth == third || fourth == second || fourth == first) {
continue;
}
if (DoSquaresFitToGreenCondition(squares[first], squares[second], squares[third], squares[fourth])) {
greenSquares.Add(new List<int> { first, second, third, fourth });
}
}
}
}
}
static bool DoSquaresFitToGreenCondition(List<int> fisrt, List<int> second, List<int> third, List<int> fourth)
{
int sumCenter = fisrt[3] + second[2] + third[1] + fourth[0];
int sumTop = first[1] + second[0];
int sumBottom = third[3] + fourth[2];
int sumLeft = first[2] + third[0];
int sumRight = second[3] + fourth[1];
return sumCenter == 10 && sumTop <= 10 && sumBottom <= 10 && sumLeft <= 10 && sumRight <= 10;
}
{
operation: 'login',
username: 'pupkin_vasya',
password: 'my$uper$ecretPa$$word'
}
или так:{
command: 'checkToken',
jwt: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c'
}