Leetcode 2303 Calculate Amount Paid in Taxes Solution in c++ | Hindi Coding Community

0

 






double calculateTax(vector<vector<int>>& b, int income) {
double res = 0, prev = 0;
for (int i = 0; i < b.size(); prev = b[i++][0])
res += max(0.0, (-prev + min(income, b[i][0])) * b[i][1] / 100);
return res;
}


Post a Comment

0Comments
Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Learn More
Accept !