File tree Expand file tree Collapse file tree 1 file changed +54
-45
lines changed
Expand file tree Collapse file tree 1 file changed +54
-45
lines changed Original file line number Diff line number Diff line change 1- class Solution {
2- public:
3- bool canBeValid(string s, string locked) {
4- int n = s.length();
5- if(n % 2 == 1)return false;
6-
7-
8- stack< int > unl;
9- stack< int > cl;
10-
11-
12- for(int i = 0; i < n ; i++)
13- {
14- if(locked[i] == 0)
15- unl.push(i);
16- else if(s[i] == '( ')
17- cl.push(i);
18- else if(s[i] == ') ')
19- {
20- if(!cl.empty())
21- cl.pop();
22- else if(!unl.empty())
23- unl.pop();
24- else {
25- cout < < "a" < < endl;
26- //return false;
27- }
28- }
1+ <!-- index.html -->
2+ <!DOCTYPE html>
3+ < html lang ="en ">
4+ < head >
5+ < meta charset ="UTF-8 ">
6+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7+ < title > My Zoo Adventures</ title >
8+ < style >
9+ body {
10+ font-family : Arial, sans-serif;
11+ line-height : 1.6 ;
12+ margin : 0 ;
13+ padding : 20px ;
14+ max-width : 800px ;
15+ margin : 0 auto;
16+ background-color : # f5f5f5 ;
2917 }
30-
31- while(!cl.empty() && !unl.empty() && cl.top() < unl.top()){
32- cl.pop();
33- unl.pop();
34-
18+ header {
19+ text-align : center;
20+ padding : 20px ;
21+ background-color : # 4CAF50 ;
22+ color : white;
23+ border-radius : 5px ;
24+ margin-bottom : 20px ;
3525 }
36-
37- if(cl.empty() && !unl.empty()){
38- cout < < "b" < < endl;
39- return (unl.size() % 2 == 0);
26+ .blog-list {
27+ background-color : white;
28+ padding : 20px ;
29+ border-radius : 5px ;
30+ box-shadow : 0 2px 5px rgba (0 , 0 , 0 , 0.1 );
4031 }
41-
42- cout < < "c" < < endl;
43- return cl.empty();
44-
45-
46-
47- }
48- };
32+ .blog-link {
33+ display : block;
34+ padding : 15px ;
35+ margin : 10px 0 ;
36+ background-color : # e9e9e9 ;
37+ color : # 333 ;
38+ text-decoration : none;
39+ border-radius : 3px ;
40+ transition : background-color 0.3s ;
41+ }
42+ .blog-link : hover {
43+ background-color : # d5d5d5 ;
44+ }
45+ </ style >
46+ </ head >
47+ < body >
48+ < header >
49+ < h1 > My Zoo Adventures</ h1 >
50+ < p > Tales from the New Delhi Zoo</ p >
51+ </ header >
52+ < div class ="blog-list ">
53+ < a href ="blog1.html " class ="blog-link "> Blog 1: A Peaceful Day at New Delhi Zoo</ a >
54+ < a href ="blog2.html " class ="blog-link "> Blog 2: The Day the Crows Attacked</ a >
55+ </ div >
56+ </ body >
57+ </ html >
You can’t perform that action at this time.
0 commit comments