21BCS7151 - Vaibhav Pratap SIngh Day 17
21BCS7151 - Vaibhav Pratap SIngh Day 17
Class/Section: 21BCS_SC_905/A
UID: 21BCS7151
return res;
}
};
vis[i][j] = 1;
vis[i][j] = 0;
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
arr = board;
s = word;
m = arr.size();
n = arr[0].size();
vector<vector<bool>>
vis(m, vector<bool>(n, 0));
for(int i = 0;i < m;i++) {
for(int j = 0;j < n;j++) {
if(f(i, j, 0, vis)) return
true;
}
}
return false;
}
};
4. Binary Watch
Solution:
class Solution {
public:
vector<string> readBinaryWatch(int turnedOn) {
switch (turnedOn){
case 0:
return {"0:00"};
break;
case 1:
return
{"0:01","0:02","0:04","0:08","0:16","0:32","1:00","2:00","4:00","8:00"};
break;
case 2:
return
{"0:03","0:05","0:06","0:09","0:10","0:12","0:17","0:18","0:20","0:24","0:33","0:34","0
}
};