Please help in this one

Please help in this one.


hello @cbcao263

image

interchange positions of n and m.

index of indices vector should be f ,in place of 0.

good way to declare vector of size n x m .
vector< vector< int> > v( n ,vector< int >(m, initial value ) );

bro

yeh nhi smjh aaya
nd Can’t I declare simply like vector<vector > v(n,m)

image
yaha pe f hoga 0 ki jagah pe.

nahi second argument mein vector declaration hona chaiye

Aisa kyu Sir, Let’s take example test case.

So f=2
And You told vect=indices[2];
which doesn’t even exist
Because indices has 2 elements one with index 0 and other with index 1.

see line 17.
f-- is written, which will decrease ur value f by 1 on every iteration.

Okayyy
Ab smjha When I took 0
I was doing only for first element of indices nd ussi ko change krrha tha.
THnx Sir

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.