mirror of
https://github.com/Manoj-HV30/dsa-competitive-programming.git
synced 2026-05-16 19:35:22 +00:00
add codeforces solutions folder
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
class Solution{
|
||||
public :
|
||||
vector<string> readBinaryWatch(int turned On){
|
||||
vector<string> ans;
|
||||
for(int i =0;i<1024;i++){
|
||||
int h = i>>6, m = i & 63;
|
||||
if(h<12 && m<60 && __builtin_popcount(i) == turnedOn)
|
||||
ans.push_back(to_string(h)+":"+(m<10?"0":"")+to_string(m));
|
||||
}
|
||||
return ans;
|
||||
}
|
||||
}
|
||||
//TC : o(1) as total number of enumerations will be independent of input size
|
||||
//SC : o(1)
|
||||
Reference in New Issue
Block a user