To load 3 C++ min, max function factors

Asked 2 years ago, Updated 2 years ago, 99 views

Creating the biggest square find problem

board[i][j] = min({board[i-1][j], board[i][j-1] , board[i-1][j-1]})+1;

I don't understand the code Originally, I know that the min function brings the minimum value out of the two factors This phrase works normally

min(1,2,3);

There was an error when I wrote it like this. I don't know how to get three factors.

c++11

2022-09-22 14:36

1 Answers

If you look closely at the code, you can see that the factor has {}, which is passed the array factor to the min function. min({1, 2, 3}) allows you to get the minimum value without errors.


2022-09-22 14:36

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.