Is there a better robust way to rewrite this using linq or any other way.
private static int getPowerIndexGreaterThanTargetPower(double target)
{
for (int i = 0; i < _color.PowerList.Count(); i++)
{
for (int j = 0; j < _color.PowerList[i].Count(); j++)
{
if (_color.PowerList[i][j] > target)
{
return j;
}
}
}
return -1;
}

Laxmidhar SahooRank #383 · 6.6K reputationPosted Dec 19, 2019, 6:15 PM EST