Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules
20 changes: 20 additions & 0 deletions src/problem1/code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
```javascript
var sum_to_n_a = function(n) {
if (n <= 0) return 0;
return n * (n + 1) / 2;
};

var sum_to_n_b = function(n) {
if (n <= 0) return 0;
var sum = 0;
for (var i = 1; i <= n; i++) {
sum += i;
}
return sum;
};

var sum_to_n_c = function(n) {
if (n <= 0) return 0;
return n + sum_to_n_c(n - 1);
};
```
38 changes: 12 additions & 26 deletions src/problem2/index.html
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
<html>

<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Fancy Form</title>

<!-- You may add more stuff here -->
<link href="style.css" rel="stylesheet" />
</head>

<body>

<!-- You may reorganise the whole HTML, as long as your form achieves the same effect. -->
<form onsubmit="return !1">
<h5>Swap</h5>
<label for="input-amount">Amount to send</label>
<input id="input-amount" />

<label for="output-amount">Amount to receive</label>
<input id="output-amount" />

<button>CONFIRM SWAP</button>
</form>
<script src="script.js"></script>
</body>

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- favicon removed -->
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Currency Swap</title>
</head>
<body class="bg-gradient-to-br from-slate-100 to-slate-200 dark:from-slate-900 dark:to-slate-950">
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
Loading