🌐 AI搜索 & 代理 主页
Skip to content

Commit 7b0fe9b

Browse files
committed
Initial commit
0 parents  commit 7b0fe9b

File tree

120 files changed

+23599
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+23599
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directories
42+
node_modules/
43+
jspm_packages/
44+
45+
# Snowpack dependency directory (https://snowpack.dev/)
46+
web_modules/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Optional stylelint cache
58+
.stylelintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variable files
76+
.env
77+
.env.development.local
78+
.env.test.local
79+
.env.production.local
80+
.env.local
81+
82+
# parcel-bundler cache (https://parceljs.org/)
83+
.cache
84+
.parcel-cache
85+
86+
# Next.js build output
87+
.next
88+
out
89+
90+
# Nuxt.js build / generate output
91+
.nuxt
92+
dist
93+
94+
# Gatsby files
95+
.cache/
96+
# Comment in the public line in if your project uses Gatsby and not Next.js
97+
# https://nextjs.org/blog/next-9-1#public-directory-support
98+
# public
99+
100+
# vuepress build output
101+
.vuepress/dist
102+
103+
# vuepress v2.x temp and cache directory
104+
.temp
105+
.cache
106+
107+
# Docusaurus cache and generated files
108+
.docusaurus
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# TernJS port file
120+
.tern-port
121+
122+
# Stores VSCode versions used for testing VSCode extensions
123+
.vscode-test
124+
125+
# yarn v2
126+
.yarn/cache
127+
.yarn/unplugged
128+
.yarn/build-state.yml
129+
.yarn/install-state.gz
130+
.pnp.*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Aman Pareek
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# JavaScript LeetCode Solutions
2+
3+
This repository contains solutions to 100+ LeetCode problems written in **JavaScript**.
4+
Each problem is solved in multiple ways — from brute force to optimized techniques.
5+
The goal is to demonstrate different approaches and help improve problem-solving skills.
6+
7+
All solutions have been tested using a custom script. Most of them should work correctly,
8+
though there may be occasional breakages depending on edge cases or updates on LeetCode's platform.
9+
10+
> 🚫 This project does not currently accept external contributions, as all content is generated dynamically from a MongoDB database.
11+
12+
13+
## 📄 Problem List (110 problems)
14+
15+
| # | Title | Link |
16+
|---|-------|------|
17+
| 1 | Check if Grid Satisfies Conditions | [Link](./solutions/check-if-grid-satisfies-conditions) |
18+
| 2 | Detect Capital | [Link](./solutions/detect-capital) |
19+
| 3 | Get first positive integer in array | [Link](./solutions/first-positive-integer-in-array) |
20+
| 4 | Additive Number | [Link](./solutions/additive-number) |
21+
| 5 | Array Partition | [Link](./solutions/array-partition) |
22+
| 6 | Array of strings containing numbers | [Link](./solutions/array-of-strings-containing-numbers) |
23+
| 7 | Can Place Flowers | [Link](./solutions/can-place-flowers) |
24+
| 8 | Check if a String Contains Only Digits | [Link](./solutions/check-if-a-string-contains-only-digits) |
25+
| 9 | Check if a String Contains Only Uppercase Letters | [Link](./solutions/check-if-a-string-contains-only-uppercase-letters) |
26+
| 10 | Check if a String is a Palindrome | [Link](./solutions/check-if-a-string-is-a-palindrome) |
27+
| 11 | Check if an Array is Sorted | [Link](./solutions/check-if-an-array-is-sorted) |
28+
| 12 | Climbing Stairs | [Link](./solutions/climbing-stairs) |
29+
| 13 | Contains Duplicate II | [Link](./solutions/contains-duplicate-ii) |
30+
| 14 | Contains Duplicate elements in array | [Link](./solutions/contains-duplicate-elements-in-array) |
31+
| 15 | Contiguous Array | [Link](./solutions/contiguous-array) |
32+
| 16 | Convert String to Title Case | [Link](./solutions/convert-string-to-title-case) |
33+
| 17 | Count Anagrams | [Link](./solutions/count-anagrams) |
34+
| 18 | Count Complete Substrings | [Link](./solutions/count-complete-substrings) |
35+
| 19 | Count Number of Vowels in a String | [Link](./solutions/count-number-of-vowels-in-a-string) |
36+
| 20 | Count and Say | [Link](./solutions/count-and-say) |
37+
| 21 | Count primes | [Link](./solutions/count-primes) |
38+
| 22 | Count the Number of Special Characters I | [Link](./solutions/count-the-number-of-special-characters-i) |
39+
| 23 | Defuse the Bomb | [Link](./solutions/defuse-the-bomb) |
40+
| 24 | Degree of an Array | [Link](./solutions/degree-of-an-array) |
41+
| 25 | Distribute Candies | [Link](./solutions/distribute-candies) |
42+
| 26 | Extract phone numbers from a block of text | [Link](./solutions/extract-phone-numbers-from-a-block-of-text) |
43+
| 27 | Extract version numbers from strings | [Link](./solutions/extract-version-numbers-from-strings) |
44+
| 28 | Factorial of a number | [Link](./solutions/factorial-of-a-number) |
45+
| 29 | Fibonacci Number | [Link](./solutions/fibonacci-number) |
46+
| 30 | Find Length of the Last Word | [Link](./solutions/find-length-of-the-last-word) |
47+
| 31 | Find Smallest Letter Greater Than Target | [Link](./solutions/find-smallest-letter-greater-than-target) |
48+
| 32 | Find Winner on a Tic Tac Toe Game | [Link](./solutions/find-winner-on-a-tic-tac-toe-game) |
49+
| 33 | Find and Remove element from array | [Link](./solutions/find-and-remove-element-from-array) |
50+
| 34 | Find second smallest and second largest element in array | [Link](./solutions/find-second-smallest-and-second-largest-element-in-array) |
51+
| 35 | Find the First Unique Character in a String | [Link](./solutions/first-unique-character-in-a-string) |
52+
| 36 | Find the Longest Word in a Sentence | [Link](./solutions/find-the-longest-word-in-a-sentence) |
53+
| 37 | Find the largest number in array | [Link](./solutions/find-the-largest-number-in-array) |
54+
| 38 | Finding the Resultant Array After Removing Anagrams | [Link](./solutions/finding-the-resultant-array-after-removing-anagrams) |
55+
| 39 | Flatten array | [Link](./solutions/flat-array) |
56+
| 40 | Generate Fibonacci Sequence | [Link](./solutions/generate-fibonacci-sequence) |
57+
| 41 | Generate Parentheses | [Link](./solutions/generate-parentheses) |
58+
| 42 | Group Anagrams | [Link](./solutions/group-anagrams) |
59+
| 43 | Integer to Roman | [Link](./solutions/integer-to-roman) |
60+
| 44 | Intersection of Two Arrays | [Link](./solutions/intersection-of-two-arrays) |
61+
| 45 | Intersection of Two Arrays II | [Link](./solutions/intersection-of-two-arrays-ii) |
62+
| 46 | Is array equal | [Link](./solutions/is-two-array-equal) |
63+
| 47 | Isomorphic Strings | [Link](./solutions/isomorphic-strings) |
64+
| 48 | Largest 3-Same-Digit Number in String | [Link](./solutions/largest-3-same-digit-number-in-string) |
65+
| 49 | Largest Odd Number in String | [Link](./solutions/largest-odd-number-in-string) |
66+
| 50 | Leaders in an Array | [Link](./solutions/leaders-in-an-array) |
67+
| 51 | Left Rotate Array in JavaScript | [Link](./solutions/left-rotate-array) |
68+
| 52 | Length of the Longest Palindrome | [Link](./solutions/length-of-the-longest-palindrome) |
69+
| 53 | Longest Common Prefix | [Link](./solutions/longest-common-prefix) |
70+
| 54 | Longest Harmonious Subsequence | [Link](./solutions/longest-harmonious-subsequence) |
71+
| 55 | Longest Palindromic Substring | [Link](./solutions/longest-palindromic-substring) |
72+
| 56 | Longest Substring with At Least K Repeating Characters | [Link](./solutions/longest-substring-with-at-least-k-repeating-characters) |
73+
| 57 | Longest Valid Parentheses | [Link](./solutions/longest-valid-parentheses) |
74+
| 58 | Majority Element | [Link](./solutions/majority-element) |
75+
| 59 | Match hex color codes | [Link](./solutions/match-hex-color-codes) |
76+
| 60 | Max Consecutive Ones | [Link](./solutions/max-consecutive-ones) |
77+
| 61 | Maximal Square | [Link](./solutions/maximal-square) |
78+
| 62 | Maximal rectangle | [Link](./solutions/maximal-rectangle) |
79+
| 63 | Maximum Average Subarray I | [Link](./solutions/maximum-average-subarray-i) |
80+
| 64 | Maximum Product Subarray | [Link](./solutions/maximum-product-subarray) |
81+
| 65 | Maximum Product of Three Numbers | [Link](./solutions/maximum-product-of-three-numbers) |
82+
| 66 | Maximum Product of Word Lengths | [Link](./solutions/maximum-product-of-word-lengths) |
83+
| 67 | Maximum Score From Removing Substrings | [Link](./solutions/maximum-score-from-removing-substrings) |
84+
| 68 | Maximum Subarray Sum | [Link](./solutions/maximum-subarray-sum) |
85+
| 69 | Maximum Sum Circular Subarray | [Link](./solutions/maximum-sum-circular-subarray) |
86+
| 70 | Min Cost Climbing Stairs | [Link](./solutions/min-cost-climbing-stairs) |
87+
| 71 | Minimum Cost of Buying Candies With Discount | [Link](./solutions/minimum-cost-of-buying-candies-with-discount) |
88+
| 72 | Minimum Index Sum of Two Lists | [Link](./solutions/minimum-index-sum-of-two-lists) |
89+
| 73 | Move All Zeros to the End of an Array | [Link](./solutions/move-all-zeros-to-the-end-of-an-array) |
90+
| 74 | Multiply Strings | [Link](./solutions/multiply-strings) |
91+
| 75 | Number of Students Unable to Eat Lunch | [Link](./solutions/number-of-students-unable-to-eat-lunch) |
92+
| 76 | Number of Substrings Containing All Three Characters | [Link](./solutions/number-of-substrings-containing-all-three-characters) |
93+
| 77 | Pascal's Triangle | [Link](./solutions/pascals-triangle) |
94+
| 78 | Pascal's Triangle II | [Link](./solutions/pascals-triangle-ii) |
95+
| 79 | Path with Maximum Gold | [Link](./solutions/path-with-maximum-gold) |
96+
| 80 | Plus One | [Link](./solutions/plus-one) |
97+
| 81 | Product of array except self | [Link](./solutions/product-of-array-except-self) |
98+
| 82 | Relative Ranks | [Link](./solutions/relative-ranks) |
99+
| 83 | Remove All Falsy Values from an Array | [Link](./solutions/remove-all-falsy-values-from-an-array) |
100+
| 84 | Remove Duplicate Letters | [Link](./solutions/remove-duplicate-letters) |
101+
| 85 | Remove Outermost Parentheses | [Link](./solutions/remove-outermost-parentheses) |
102+
| 86 | Remove the Last Element from an Array | [Link](./solutions/remove-the-last-element-from-an-array) |
103+
| 87 | Replace Words | [Link](./solutions/replace-words) |
104+
| 88 | Reverse Every Word in a String | [Link](./solutions/reverse-every-word-in-a-string) |
105+
| 89 | Reverse String | [Link](./solutions/reverse-string) |
106+
| 90 | Reverse Vowels of a String | [Link](./solutions/reverse-vowels-of-a-string) |
107+
| 91 | Reverse the Odd-Length Words in a String | [Link](./solutions/reverse-the-odd-length-words-in-a-string) |
108+
| 92 | Reverse words in a string | [Link](./solutions/reverse-words-in-a-string) |
109+
| 93 | Right Rotate Array in JavaScript | [Link](./solutions/right-rotate-array-in-javascript) |
110+
| 94 | Roman to Integer | [Link](./solutions/roman-to-integer) |
111+
| 95 | Search Insert Position | [Link](./solutions/search-insert-position) |
112+
| 96 | Set Matrix Zeroes | [Link](./solutions/set-matrix-zeroes) |
113+
| 97 | Shortest Palindrome | [Link](./solutions/shortest-palindrome) |
114+
| 98 | Single Number | [Link](./solutions/single-number) |
115+
| 99 | Sort Characters By Frequency | [Link](./solutions/sort-characters-by-frequency-leetcode) |
116+
| 100 | Sort Colors | [Link](./solutions/sort-colors) |
117+
| 101 | Split a String into a Fibonacci Sequence | [Link](./solutions/split-a-string-into-a-fibonacci-sequence) |
118+
| 102 | Sum of Digits | [Link](./solutions/sum-of-digits) |
119+
| 103 | Three Consecutive Odds | [Link](./solutions/three-consecutive-odds) |
120+
| 104 | Time Needed to Buy Tickets | [Link](./solutions/time-needed-to-buy-tickets) |
121+
| 105 | Two Sum | [Link](./solutions/two-sum) |
122+
| 106 | Union of Two Sorted Arrays | [Link](./solutions/union-of-two-sorted-arrays) |
123+
| 107 | Valid Anagram | [Link](./solutions/valid-anagram) |
124+
| 108 | Validate Email Address | [Link](./solutions/regex-validate-email-addresses) |
125+
| 109 | Word Pattern | [Link](./solutions/word-pattern) |
126+
| 110 | check whether one string is a rotation of another | [Link](./solutions/check-one-string-is-rotation-of-another) |
127+
128+
129+
## 📄 License
130+
131+
This project is licensed under the MIT License – see the [LICENSE](./LICENSE) file for details.

0 commit comments

Comments
 (0)