Skip to content

Commit 702beea

Browse files
fix: or condition in cpp
1 parent bf34a80 commit 702beea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

DynamicProgramming/MinUmbrellaNeeded.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ using namespace std;
1414

1515
int min_umbrellas_needed_util(int n, vector<int> umbrellas, vector<int> dp, int count){
1616
// if dp has already stored the solution for n people, return
17-
if(n == 0 or dp[n] != 0) return dp[n];
17+
if(n == 0 || dp[n] != 0) return dp[n];
1818

1919
int min_count = INT_MAX, curr_count;
2020

2121
// Iterate over all the umbrella sizes
2222
for(auto i = umbrellas.begin(); i != umbrellas.end(); i++){
2323

24-
// if umbrella can be accomodated fully
24+
// if umbrella can be accommodated fully
2525
if(n - *i > 0)
2626
curr_count = min_umbrellas_needed_util(n-*i, umbrellas, dp, count+1);
2727

28-
// if all people are accomodated
28+
// if all people are accommodated
2929
else if(n - *i == 0)
3030
curr_count = count+1;
3131

0 commit comments

Comments
 (0)