Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 62fbd39

Browse files
doc/doc: Add README file
1 parent fb790e5 commit 62fbd39

File tree

7 files changed

+136
-21
lines changed

7 files changed

+136
-21
lines changed

‎README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,45 @@
1-
# leetstream.github.io
1+
# LeetStream
2+
3+
## What is LeetStream?
4+
5+
LeetStream is a static website designed to help users improve their coding skills through daily practice with *LeetCode* problems. The website offers a curated selection of **220 problems** categorized into **26 coding patterns**, including sliding window, greedy algorithms, dynamic programming, and more. Each day, users are presented with the same *LeetCode* problem, shuffled to ensure spaced repetition across different coding patterns. By solving these problems and submitting their data, users can track their progress and identify areas for improvement.
6+
7+
## How to Use?
8+
9+
Using LeetStream is simple:
10+
11+
1. **Solve the Daily Problem**: Each day, you'll be presented with a LeetCode problem categorized under one of the 26 coding patterns. Solve the problem to the best of your ability. **Remember, once the day is over, you won't be able to revisit or solve the problem again, so make it a habit to solve it daily.**
12+
2. **Submit Data**: After solving the problem, submit your data to calculate your score. Include information such as bugs encountered, hints used, time taken, and the type of solution (optimal, sub-optimal, brute force, ...).
13+
3. **Review Results**: Once you've submitted your data, review your score. You can download a **CSV file** containing your scores to further analyze your performance using spreadsheet programs. This file will help you gain deeper insights into your strengths and areas for improvement.
14+
4. **Access Study Material**: Explore links to articles and videos related to the coding patterns present in the problem you just solved. Use this material to deepen your understanding and improve your skills.
15+
5. **Repeat Daily**: Come back each day to tackle a new problem, track your progress, and continue learning. Remember, consistency is key, as you won't have another chance to solve missed problems.
16+
17+
## Security and Privacy
18+
19+
LeetStream prioritizes the security and privacy of its users. The website is a static site, and user data is stored locally in the browser's local storage. This means that your data remains safe and private, accessible only to you on the device where you are using LeetStream. We do not collect any personally identifiable information or store user data on external servers, ensuring your privacy is maintained.
20+
21+
## How to Contribute?
22+
23+
We welcome contributions from the community to enhance LeetStream. Here's how you can contribute:
24+
25+
- **Provide Problem Data**: Help us enrich our database by adding information about problem difficulty, associated companies, solution links, and relevant articles/videos for coding patterns. You can contribute by using the following links to enrich the database:
26+
- [Coding Interview Patterns GitBook](https://dvpr.gitbook.io/coding-interview-patterns/)
27+
- [Grokking the Coding Interview Patterns for Coding Questions GitHub](https://github.com/dipjul/Grokking-the-Coding-Interview-Patterns-for-Coding-Questions/)
28+
- [Grokking the Coding Interview: Patterns for Coding Questions Course](https://www.designgurus.io/course-play/grokking-the-coding-interview/)
29+
- [Grokking to LeetCode Gist](https://gist.github.com/tykurtz/3548a31f673588c05c89f9ca42067bc4)
30+
- [New Grokking to LeetCode GitHub](https://github.com/navidre/new_grokking_to_leetcode)
31+
- [NeetCode | YouTube](https://www.youtube.com/@NeetCode/videos)
32+
- [Algorithmic Patterns for Coding Interview/LeetCode Problems | YouTube](https://www.youtube.com/playlist?list=PL7g1jYj15RUOjoeZAJsWjwV8XUo9r0hwc)
33+
- [Coding Pattern | YouTube](https://www.youtube.com/playlist?list=PLYMuCXiM_KMh5C4MsPBN25VWO1sue1Hvk)
34+
- [Coding Interview Patterns | YouTube](https://www.youtube.com/playlist?list=PLB7ZlVMcmjIDUDmOnoIRATIblml0hBt57)
35+
- [LeetcodeCa](https://leetcode.ca/all/243.html)
36+
- **Ensure High-Quality References**: When providing references, ensure they are **high-quality resources**. References from presenters working in **big tech** companies, **competitive programming champions**, individuals with more than **seven years of non-repetitive experience** in the software industry, or equivalents are preferred. This helps avoid false positives and decreases the chance of wasting users' time.
37+
- **Add Features**: Suggest and implement new features to improve the user experience or enhance functionality.
38+
- **Report Issues**: If you encounter any bugs or have suggestions for improvements, create an issue on our GitHub repository.
39+
- **Documentation**: Improve the documentation to make it more comprehensive and user-friendly.
40+
41+
To contribute, simply fork our GitHub repository and submit a pull request with your changes. Together, we can make LeetStream an even more valuable resource for coding enthusiasts.
42+
43+
## Contributors
44+
45+
- [Maintainer](https://github.com/mohamed-sallam): Mohamed Sallam

‎components/Done.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { getProblemOfDay, problems } from "../db/problems.js";
2+
import { Component } from "./Component.js";
23

3-
class Done extends HTMLElement {
4+
class Done extends Component {
45
constructor() {
56
super();
6-
const todaysProblem = problems[getProblemOfDay()];
7-
this.patterns = todaysProblem.patterns;
8-
this.solutions = todaysProblem.solutions;
9-
this.innerHTML = this.render();
107
}
118

129
render() {
10+
const todaysProblem = problems[getProblemOfDay()];
11+
const patterns = todaysProblem.patterns;
12+
const solutions = todaysProblem.solutions;
1313
return /*HTML*/ `
1414
<confettiful-comp>
1515
<div class="references">
1616
<div class="patterns">
17-
${this.patterns
17+
${patterns
1818
.map((pattern) => {
1919
return /*HTML*/ `
2020
<div class="pattern">
@@ -44,7 +44,7 @@ class Done extends HTMLElement {
4444
<div class="solutions">
4545
<h2>Solutions</h2>
4646
<span class="badges">
47-
${this.solutions
47+
${solutions
4848
.map((solution) => {
4949
return /*HTML*/ `
5050
<a href="${

‎components/MarkdownRenderer.js

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import { ShadowComponent } from "./ShadowComponent.js";
2+
import { marked } from "https://cdn.jsdelivr.net/npm/marked/lib/marked.esm.js";
3+
4+
export class MarkdownRenderer extends ShadowComponent {
5+
constructor() {
6+
super();
7+
}
8+
9+
render() {
10+
return /*HTML*/ `
11+
<style>
12+
/* Dark mode styles */
13+
:host {
14+
display: block;
15+
background-color: black;
16+
color: #d4d4d4;
17+
line-height: 1.6;
18+
max-width: 75ch;
19+
margin: 0 auto;
20+
text-align: justify;
21+
padding-bottom: 2rem;
22+
}
23+
24+
a {
25+
color: #0366d6;
26+
text-decoration: none;
27+
}
28+
29+
a:hover {
30+
text-decoration: underline;
31+
}
32+
33+
h1 {
34+
display: none;
35+
}
36+
</style>
37+
<div class="markdown-body">
38+
<!-- Markdown content will be inserted here -->
39+
</div>
40+
`;
41+
}
42+
43+
connectedCallback() {
44+
const src = this.getAttribute("src");
45+
46+
fetch(src)
47+
.then((response) => response.text())
48+
.then((text) => {
49+
const html = marked(text);
50+
51+
this.shadow.querySelector(".markdown-body").innerHTML = html;
52+
})
53+
.catch((error) => {
54+
console.error("Error fetching Markdown file:", error);
55+
});
56+
}
57+
}
58+
59+
customElements.define("markdown-renderer", MarkdownRenderer);

‎db/problems.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const problems = [
9494
solutions: [
9595
{
9696
title: "",
97-
site: "",
97+
site: sites.yt,
9898
url: "https://www.youtube.com/watch?v=1IUzNJ6TPEM",
9999
},
100100
],

‎index.html

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<script defer src="./components/Done.js" type="module"></script>
1111
<script defer src="./components/Confettiful.js" type="module"></script>
1212
<script defer src="./components/ContributeButton.js" type="module"></script>
13+
<script defer src="./components/MarkdownRenderer.js" type="module"></script>
1314
</head>
1415

1516
<body>
@@ -18,16 +19,16 @@
1819
<nav>
1920
<h2 class="logo"><span class="logo-text">LeetStream</span> 🌊</h2>
2021
<ul>
21-
<li>🏠 <a href="index.html" class="active">Home</a></li>
22-
<li>📚 <a href="usage.html">How to Use</a></li>
22+
<li>🏠 <a href="/" class="active">Home</a></li>
23+
<li>📚 <a href="#usage">How to Use</a></li>
2324
<li>🤝 <a href="https://github.com/LeetStream/leetstream.github.io">Contribute</a></li>
2425
<li><button id="export">📤 Export as CSV</button></li>
2526
</ul>
2627
</nav>
27-
<div id="content">
28-
29-
</div>
3028
</header>
29+
<div id="content">
30+
31+
</div>
3132

3233
</body>
3334

‎routers.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,27 @@ import { UserDb } from "./db/userDb.js";
44
export const routers = {
55
problem: "<problem-form/>",
66
done: "<done-comp/>",
7+
usage: /*HTML*/ `
8+
<markdown-renderer src="./README.md">
9+
</markdown-renderer>
10+
`,
711
};
812

9-
export function routerRules() {
13+
export function routingRules() {
1014
if (
11-
UserDb.get().problems.length !== 0 &&
15+
location.hash.slice(1) === "done" &&
16+
(UserDb.get().problems.length === 0 ||
17+
UserDb.get().problems[UserDb.get().problems.length - 1].index !==
18+
getProblemOfDay())
19+
)
20+
location.hash = "";
21+
else if (
22+
UserDb.get().problems.length > 0 &&
1223
UserDb.get().problems[UserDb.get().problems.length - 1].index ===
13-
getProblemOfDay()
24+
getProblemOfDay() &&
25+
["", "problem"].includes(location.hash.slice(1))
1426
)
1527
location.hash = "done";
16-
else if (location.hash.slice(1) === "done") location.hash = "";
1728
}
1829

1930
export function router() {

‎script.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { problems } from "./db/problems.js";
22
import { UserDb } from "./db/userDb.js";
3-
import { router, routerRules } from "./routers.js";
3+
import { router, routingRules } from "./routers.js";
44

55
window.addEventListener("hashchange", router);
66
window.addEventListener("load", router);
7-
window.addEventListener("hashchange", routerRules);
8-
window.addEventListener("load", routerRules);
7+
window.addEventListener("hashchange", routingRules);
8+
window.addEventListener("load", routingRules);
99

1010
document.querySelector("#export").addEventListener("click", () => {
1111
const data = UserDb.get().problems;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /