I want to initialize a 2D array with -1 as all the value. I used memset() for this.
memset()
#include using namespace std; int dp[100]
for (auto& v : dp) { std::fill(std::begin(v), std::end(v), -1); }
Inside function, not global scope.