My answers to LeetCode, HackerRank, Codewars etc.
coding-puzzle/
├── Java-training/
│ └── src/
│ ├── main/java/
│ │ ├── org/codewars/
│ │ │ ├── CloseCompare.java
│ │ │ └── ...
│ │ └── org/leetcode/
│ │ ├── TwoSum.java
│ │ └── ...
│ └── test/java/
│ ├── org/codewars/
│ │ ├── CloseCompareTest.java
│ │ └── ...
│ └── org/leetcode/
│ ├── TwoSumTest.java
│ └── ...
├── javascript-training/
│ ├── src/
│ │ ├── codewars/
│ │ │ ├── multiply.js
│ │ │ └── ...
│ │ └── leetcode/
│ │ ├── validPalindrome.js
│ │ └── ...
│ └── test/
│ ├── codewars/
│ │ ├── multiplyTest.js
│ │ └── ...
│ └── leetcode/
│ ├── validPalindromeTest.js
│ └── ...
├── typescript-training/
│ ├── src/
│ │ ├── codewars/
│ │ │ ├── rockPaperScissors.ts
│ │ │ └── ...
│ │ └── leetcode/
│ │ ├── twoSum.ts
│ │ └── ...
│ └── test/
│ ├── codewars/
│ │ ├── rockPaperScissorsTest.ts
│ │ └── ...
│ └── leetcode/
│ ├── twoSumTest.ts
│ └── ...
└── RandomWebSites/Leetcode Problems
| No. | Questions | Language |
|---|---|---|
| 1 | Two Sum | Java |
| 3 | Longest Substring Without Repeating Characters | JavaScript |
| 11 | Container With Most Water | TypeScript |
| 13 | Roman To Integer | JavaScript |
| 27 | Remove Element | Java |
| 34 | Find First and Last Position of Element in Sorted Array | JavaScript |
| 35 | Search Insert Position | JavaScript |
| 42 | Trapping Rain Water | JavaScript |
| 66 | Plus One | Java |
| 70 | Climbing Stairs | TypeScript |
| 75 | Sort Colors | JavaScript |
| 92 | Rever Linked List II | JavaScript |
| 125 | Valid Palindrome | JavaScript |
| 136 | Single Number | Java |
| 206 | Reverse Linked List | Java |
| 225 | Implement Stack using Queues | JavaScript |
| 232 | Implement Queue using Stacks | JavaScript |
| 268 | Missing Number | JavaScript |
| 287 | Find the Duplicate Number | Java |
| 387 | First Unique Character in A String | JavaScript |
| 412 | Fizz Buzz | Java |
| 680 | Valid Palindrome II | JavaScript |
| 704 | Binary Search | JavaScript |
| 844 | Backspace String Compare | JavaScript |
| 1351 | Count Negative Numbers in a Sorted Matrix | JavaScript |
| 2089 | Find Target Indices After Sorting Array | JavaScript |
| 2455 | Average Value of Even Numbers That Are Divisible by Three | JavaScript |
| 2485 | Find the Pivot Integer | JavaScript |
| 2529 | Maximum Count of Positive Integer and Negative Integer | Java |
| 2535 | Difference Between Element Sum and Digit Sum of an Array | JavaScript |
| 2536 | Increment Submatrices by One | JavaScript |
HackerRank Problems
| Questions | Language |
|---|---|
| Arrays - DS | JavaScript |
| 2D Arrays - DS | JavaScript |
| HR Weather Observation Station 5 | SQL |
| Java String Reverse | Java |
Codewars Problems
| Question | Language |
|---|---|
| Sum of positive | Java |
| Removing elements | Java |
| Convert a string to an array | Typescript |
| Is the string uppercase? | Java |
| Disemvowel Trolls | Java |
| My head is at the wrong end | Java |
| Opposite number | Java |
| Remove first and last character | Java |
| Rock Paper Scissors | Typescript |
| String ends with | Java |
| Sum Arrays | Java |
JavaScript / TypeScript
- Node.js v18 or higher
- npm v9 or higher (bundled with Node.js)
Java
- JDK 17 or higher
- Gradle 8.14 or higher
JavaScript / TypeScript
- Mocha — test runner (
describe/it) - Chai — assertion library (
assert) - ts-node — runs TypeScript test/source files directly without a separate build step (TypeScript repo only)
Java
JavaScript / TypeScript
npm installJava — dependencies are resolved automatically the first time you run ./gradlew build or ./gradlew test; no separate install step needed.
npm testThis runs all test files matching test/**/*Test.ts (or .js, depending on the repo) via Mocha.
./gradlew testThis runs all classes ending in Test under src/test/java via Gradle's built-in JUnit Platform support.
./gradlew test --tests "org.leetcode.ValidAnagramTest.*"./gradlew test --tests "org.leetcode.ValidAnagramTest"./gradlew test --tests "org.leetcode.ValidAnagramTest.testCase2"-
Open
JavaLeetCodeand test folder -
Click the 🟢 green play button:
- Next to class → runs all tests
- Next to method → runs a single test