-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpuzzle7.html
More file actions
207 lines (186 loc) · 6.4 KB
/
puzzle7.html
File metadata and controls
207 lines (186 loc) · 6.4 KB
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
205
206
207
<!DOCTYPE HTML>
<html>
<head>
<title>TBPuzzle - Puzzles</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<link rel="stylesheet" href="assets/css/main.css" />
<link rel="stylesheet" href="assets/css/puzzle.css" />
<link rel='icon' href='images/favi.png' type='image/png'/>
<noscript><link rel="stylesheet" href="assets/css/noscript.css" /></noscript>
<link rel="stylesheet" href="//cdn.quilljs.com/1.3.6/quill.bubble.css">
<script src="//cdn.quilljs.com/1.3.6/quill.js"></script>
<script src="https://pagecdn.io/lib/ace/1.4.5/ace.js" integrity="sha256-5Xkhn3k/1rbXB+Q/DX/2RuAtaB4dRRyQvMs83prFjpM=" crossorigin="anonymous"></script>
<style type="text/css" media="screen">
</style>
</head>
<body class="is-preload landing">
<!-- Wrapper -->
<div id="wrapper">
<!-- Header -->
<header id="header">
<div class="inner">
<!-- Logo -->
<a href="/puzzle" class="logo" onmouseover="onHover();" onmouseout="offHover();">
<span class="symbol"><img id="logo" src="images/logo2.svg" alt=""/></span>
<span class="title">TBPuzzle</span>
</a>
<!-- Nav -->
<nav>
<ul>
<li><a href="#menu">Menu</a></li>
</ul>
</nav>
</div>
</header>
<!-- Menu -->
<nav id="menu">
<h2>Menu</h2>
<ul>
<li id="menu-home"><a href="/">Home</a></li>
<li><a href="team">Team</a></li>
<li><a href="puzzle">Puzzles</a></li>
<li><a href="leaderboard">Leaderboard</a></li>
<li><a href="thanks">Thanks</a></li>
</ul>
</nav>
<!-- Main -->
<div id="main">
<div class="inner">
<div class="in-team">
<header>
<h1>Leat Code</h1>
<p>Puzzle Credits: Owen Shen</p>
</header>
<h2> 1. Two Sum </h2>
<h3 style="color: seagreen; display: inline;">Easy </h3>  
<h3 style="display: inline;">
<i id="up" class="fas fa-thumbs-up" onclick="clickUp()"></i> 13967  
<i id="down" class="fas fa-thumbs-down" onclick="clickDown()"></i> 511  
<i id="heart" class="fas fa-heart" onclick="clickHeart()"></i> Add to List  
<i id="share" class="fas fa-share" onclick="clickShare()"></i> Share
</h3>
<br>
<div class="line"></div>
<p>
Given an array of integers, return <strong>indices</strong> of the two numbers such that they add up to a specific target.
<br>
You may assume that each input would have <strong><i>exactly</i></strong> one solution, and you may not use the same element twice.<br>
Be sure to pay close attention to the error messages, and look out for indentation errors.<br>
Tabs will overwrite previous 3 spaces.<br>
<br>
<strong>Example:</strong>
</p>
<div id="example">
<p> Given nums = [2, 7, 11, 15], target = 9, </p>
<br>
<p> Because nums[0] + nums[1] = 2 + 7 = 9, </p>
<p> return [0, 1]. </p>
</div>
<br>
<p>
Accepted 2,674,920   |   Submissions 5,922,815
</p>
<div class="line"></div>
<div id="output" style="color:#f2849e"></div>
<form id="code-editor" method="post" onsubmit="return runCode(editor.getValue())">
<div id="parent">
<div id="editor">#Syntax highlighting only supported in Python
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
</div>
</div>
<input type="submit" value="Run Code"/>
</form>
<br>
<form id="puzzle-box" method="post" onsubmit="return verify()">
<div class="fields">
<div class="field half">
<input type="text" name="answer" id="answer" placeholder="Answer" maxlength="50"></input>
<div id="answer-error" style="color: #f2849e;"></div>
</div>
</div>
<ul class="actions">
<li><input type="submit" value="Submit" class="primary" /></li>
</ul>
</form>
<div id="puzzle-done">
<h2>Correct</h2>
</div>
</div>
</div>
</div>
</div>
<!-- The core Firebase JS SDK is always required and must be listed first -->
<script src="https://www.gstatic.com/firebasejs/7.6.0/firebase-app.js"></script>
<script>
// Your web app's Firebase configuration
var firebaseConfig = {
apiKey: "AIzaSyD0PQiCeZqc9Ne1QCX0D4zRls35KJYBe8A",
authDomain: "tbpuzzlehunt.firebaseapp.com",
databaseURL: "https://tbpuzzlehunt.firebaseio.com",
projectId: "tbpuzzlehunt",
storageBucket: "tbpuzzlehunt.appspot.com",
messagingSenderId: "737659509987",
appId: "1:737659509987:web:c1e3317ad8e1d23700b9d6",
measurementId: "G-YBW1LK2DZ7"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
</script>
<script src="https://www.gstatic.com/firebasejs/7.6.0/firebase-auth.js"></script>
<!-- Scripts -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/browser.min.js"></script>
<script src="assets/js/breakpoints.min.js"></script>
<script src="assets/js/util.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/puzzle.js"></script>
<script>
var example = new Quill('#example', {
theme: 'bubble',
});
example.enable(false);
</script>
<script>
var editor = ace.edit("editor");
editor.setTheme("ace/theme/monokai");
editor.session.setMode("ace/mode/python");
editor.session.setUseSoftTabs(false);
editor.setShowInvisibles(true);
editor.setOptions({ fontSize: "10pt" });
</script>
<script>
function clickUp() {
if ($("#up").css("color") == "rgb(255, 255, 255)") {
$("#up").css("color", "forestgreen");
} else {
$("#up").css("color", "rgb(255, 255, 255)");
}
$("#down").css("color", "rgb(255, 255, 255)");
}
function clickDown() {
if ($("#down").css("color") == "rgb(255, 255, 255)") {
$("#down").css("color", "#B2170E");
} else {
$("#down").css("color", "rgb(255, 255, 255)");
}
$("#up").css("color", "rgb(255, 255, 255)");
}
function clickHeart() {
if ($("#heart").css("color") == "rgb(255, 255, 255)") {
$("#heart").css("color", "pink");
} else {
$("#heart").css("color", "rgb(255, 255, 255)");
}
}
function clickShare() {
if ($("#share").css("color") == "rgb(255, 255, 255)") {
$("#share").css("color", "#5DADE2");
} else {
$("#share").css("color", "rgb(255, 255, 255)");
}
}
</script>
</body>
</html>