forked from PRIYESHSINGH24/DSA_SOLUTION_PLATFORM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
geeksforgeeks.html
204 lines (184 loc) · 6.32 KB
/
geeksforgeeks.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GeeksforGeeks Problems - DSA Problem Solutions</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body {
background-color: #f4f7fc;
color: #333;
display: flex;
flex-direction: column;
min-height: 100vh;
}
header {
background-color: #24292e;
color: #fff;
padding: 20px;
text-align: center;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
header h1 {
font-size: 2.5rem;
font-weight: 600;
}
.container {
display: flex;
flex: 1;
height: calc(100vh - 60px); /* Adjust based on your header height */
}
.problems-list {
width: 50%;
padding: 20px;
overflow-y: auto;
}
.solution-display {
width: 50%;
padding: 20px;
background-color: #f0f0f0;
overflow-y: auto;
}
.card {
background-color: #fff;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
}
.card-header {
padding: 15px 20px;
border-bottom: 1px solid #e0e0e0;
}
.card-title {
font-size: 1.2rem;
font-weight: 600;
}
.card-content {
padding: 15px 20px;
}
.button-container {
display: flex;
justify-content: flex-end;
margin-top: 15px;
}
.button {
padding: 8px 16px;
border: none;
border-radius: 5px;
cursor: pointer;
font-size: 0.9rem;
display: flex;
align-items: center;
transition: background-color 0.3s;
}
.button:not(:last-child) {
margin-right: 10px;
}
.button-primary {
background-color: #4CAF50;
color: white;
}
.button-outline {
background-color: transparent;
color: #4CAF50;
border: 1px solid #4CAF50;
}
.button:hover {
opacity: 0.9;
}
.icon {
margin-right: 5px;
}
</style>
</head>
<body>
<header>
<h1>GeeksforGeeks Problems</h1>
</header>
<div class="container">
<div class="problems-list">
<h2 style="font-size: 1.5rem; font-weight: 600; margin-bottom: 20px;">Problems</h2>
<div class="card">
<div class="card-header">
<h3 class="card-title">Two Sum</h3>
</div>
<div class="card-content">
<p>Difficulty: Easy</p>
<div class="button-container">
<button class="button button-primary" onclick="handleViewSolution('Two Sum')">
<span class="icon">▶</span> View Solution
</button>
<button class="button button-outline" onclick="handleContribute('Two Sum')">
<span class="icon">✏</span> Contribute
</button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h3 class="card-title">Reverse Linked List</h3>
</div>
<div class="card-content">
<p>Difficulty: Medium</p>
<div class="button-container">
<button class="button button-primary" onclick="handleViewSolution('Reverse Linked List')">
<span class="icon">▶</span> View Solution
</button>
<button class="button button-outline" onclick="handleContribute('Reverse Linked List')">
<span class="icon">✏</span> Contribute
</button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<h3 class="card-title">Binary Tree Level Order Traversal</h3>
</div>
<div class="card-content">
<p>Difficulty: Medium</p>
<div class="button-container">
<button class="button button-primary" onclick="handleViewSolution('Binary Tree Level Order Traversal')">
<span class="icon">▶</span> View Solution
</button>
<button class="button button-outline" onclick="handleContribute('Binary Tree Level Order Traversal')">
<span class="icon">✏</span> Contribute
</button>
</div>
</div>
</div>
</div>
<div class="solution-display">
<h2 style="font-size: 1.5rem; font-weight: 600; margin-bottom: 20px;">Solution</h2>
<div id="solution-content">
<p>Select a problem to view its solution.</p>
</div>
</div>
</div>
<script>
function handleViewSolution(problemTitle) {
const solutionContent = document.getElementById('solution-content');
solutionContent.innerHTML = `
<div class="card">
<div class="card-header">
<h3 class="card-title">${problemTitle} Solution</h3>
</div>
<div class="card-content">
<p>Solution for ${problemTitle} goes here...</p>
</div>
</div>
`;
}
function handleContribute(problemTitle) {
alert(`Contributing to: ${problemTitle}`);
// Implement contribution logic here
}
</script>
</body>
</html>