From 30ac3dbea0981e79551bb181371f9f202c78c576 Mon Sep 17 00:00:00 2001 From: sambabib Date: Mon, 23 Sep 2024 11:23:31 +0100 Subject: [PATCH 1/8] added js solution to _3 --- .gitignore | 3 ++- javascript/_3.js | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 javascript/_3.js diff --git a/.gitignore b/.gitignore index b7dfd6457a..c6b4f54e91 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ out/ *.vscode/ src/main/java/com/fishercoder/solutions/_99999RandomQuestions.java src/main/java/com/fishercoder/solutions/_Contest.java -.project \ No newline at end of file +.project +bin \ No newline at end of file diff --git a/javascript/_3.js b/javascript/_3.js new file mode 100644 index 0000000000..2218e25361 --- /dev/null +++ b/javascript/_3.js @@ -0,0 +1,23 @@ +function lengthOfLongestSubstring(s) { + // Using the "sliding window" data structure. + // Create a javascript set to store unique characters. + let charSet = new Set(); + let left = 0; // Left pointer of the sliding window. + let maxLength = 0; + + // This moves the right pointer of the sliding window. + for (let right = 0; right < s.length; right++) { + // If the character at the right pointer is already in the set, move the left pointer. + while (charSet.has(s[right])) { + charSet.delete(s[left]); + left++; + } + // Add the current character at the right pointer to the set. + charSet.add(s[right]); + + // Update the maximum length of substring without repeating characters. + maxLength = Math.max(maxLength, right - left + 1); + } + + return maxLength; +} \ No newline at end of file From 9447151eb5253e8e0c1bb8ad861a818c5bf5fdea Mon Sep 17 00:00:00 2001 From: sambabib Date: Wed, 9 Oct 2024 14:31:50 +0100 Subject: [PATCH 2/8] js solution to _17 --- javascript/_17.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 javascript/_17.js diff --git a/javascript/_17.js b/javascript/_17.js new file mode 100644 index 0000000000..f950e696de --- /dev/null +++ b/javascript/_17.js @@ -0,0 +1,43 @@ +function letterCombinations(digits) { + // If the input is an empty string, return an empty array. + if (digits.length === 0) { + return []; + } + + // Mapping of digits to letters as per the telephone keypad using a javascript dictionary. + const digitToChar = { + '2': ['a', 'b', 'c'], + '3': ['d', 'e', 'f'], + '4': ['g', 'h', 'i'], + '5': ['j', 'k', 'l'], + '6': ['m', 'n', 'o'], + '7': ['p', 'q', 'r', 's'], + '8': ['t', 'u', 'v'], + '9': ['w', 'x', 'y', 'z'] + }; + + // Resultant array to store all possible combinations + const result = []; + + // Backtracking function to generate combinations + function backtrack(index, currentCombination) { + // if the current combination has the same length as the input digits. + if (index === digits.length) { + result.push(currentCombination); + return; + } + + // Get the letters that the current digit maps to. + let letters = digitToChar[digits[index]]; + + // Loop through the letters and call backtrack recursively for the next digit. + for (let letter of letters) { + backtrack(index + 1, currentCombination + letter); + } + } + + // Start backtracking from the first digit (index 0) with an empty string as the initial combination. + backtrack(0, ''); + + return result; +}; From 4ca41ba941da14fc113cd4e4f2808b9d4704e9e7 Mon Sep 17 00:00:00 2001 From: sambabib Date: Tue, 15 Oct 2024 10:38:01 +0100 Subject: [PATCH 3/8] added js solution links to readme --- paginated_contents/algorithms/1st_thousand/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paginated_contents/algorithms/1st_thousand/README.md b/paginated_contents/algorithms/1st_thousand/README.md index d9601619b0..28bfa81295 100644 --- a/paginated_contents/algorithms/1st_thousand/README.md +++ b/paginated_contents/algorithms/1st_thousand/README.md @@ -796,7 +796,7 @@ | 20 | [Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_20.java) | [:tv:](https://www.youtube.com/watch?v=eBbg5pnq5Zg) | Easy | Stack | 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_19.java) | [:tv:](https://youtu.be/Kka8VgyFZfc) | Medium | Linked List | 18 | [4 Sum](https://leetcode.com/problems/4sum/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_18.java) || Medium | Two Pointers -| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_17.java) || Medium | Backtracking +| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_17.java), [Javascript](https://github.com/sambabib/Leetcode/blob/sambabib-js-solutions/javascript/_17.js) || Medium | Backtracking | 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_16.java) || Medium | Two Pointers | 15 | [3Sum](https://leetcode.com/problems/3sum/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_15.java), [C++](../master/cpp/_15.cpp) | [:tv:](https://www.youtube.com/watch?v=jeim_j8VdiM) | Medium | Two Pointers, Binary Search | 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_14.java) | [:tv:](https://www.youtube.com/watch?v=K1ps6d7YCy4) | Easy @@ -810,6 +810,6 @@ | 6 | [ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_6.java) | | Easy | | 5 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_5.java) | | Medium | | 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_4.java), [C++](../master/cpp/_4.cpp) | | Hard | Divide and Conquer -| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_3.java), [C++](../master/cpp/_3.cpp) | | Medium | HashMap, Sliding Window +| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_3.java), [C++](../master/cpp/_3.cpp), [Javascript](https://github.com/sambabib/Leetcode/blob/sambabib-js-solutions/javascript/_3.js) | | Medium | HashMap, Sliding Window | 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_2.java) | | Medium | LinkedList | 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_1.java), [C++](../master/cpp/_1.cpp), [Javascript](../master/javascript/_1.js) | [:tv:](https://www.youtube.com/watch?v=kPXOr6pW8KM&t=) | Easy | HashMap \ No newline at end of file From daed7dc3b148d9fea4687a354ba047a61e7e4379 Mon Sep 17 00:00:00 2001 From: sambabib Date: Wed, 16 Oct 2024 09:53:00 +0100 Subject: [PATCH 4/8] updated links to js solutions --- paginated_contents/algorithms/1st_thousand/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paginated_contents/algorithms/1st_thousand/README.md b/paginated_contents/algorithms/1st_thousand/README.md index 28bfa81295..24e367d524 100644 --- a/paginated_contents/algorithms/1st_thousand/README.md +++ b/paginated_contents/algorithms/1st_thousand/README.md @@ -796,7 +796,7 @@ | 20 | [Valid Parentheses](https://leetcode.com/problems/valid-parentheses/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_20.java) | [:tv:](https://www.youtube.com/watch?v=eBbg5pnq5Zg) | Easy | Stack | 19 | [Remove Nth Node From End of List](https://leetcode.com/problems/remove-nth-node-from-end-of-list/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_19.java) | [:tv:](https://youtu.be/Kka8VgyFZfc) | Medium | Linked List | 18 | [4 Sum](https://leetcode.com/problems/4sum/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_18.java) || Medium | Two Pointers -| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_17.java), [Javascript](https://github.com/sambabib/Leetcode/blob/sambabib-js-solutions/javascript/_17.js) || Medium | Backtracking +| 17 | [Letter Combinations of a Phone Number](https://leetcode.com/problems/letter-combinations-of-a-phone-number/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_17.java), [Javascript](https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_17.js) || Medium | Backtracking | 16 | [3Sum Closest](https://leetcode.com/problems/3sum-closest/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_16.java) || Medium | Two Pointers | 15 | [3Sum](https://leetcode.com/problems/3sum/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_15.java), [C++](../master/cpp/_15.cpp) | [:tv:](https://www.youtube.com/watch?v=jeim_j8VdiM) | Medium | Two Pointers, Binary Search | 14 | [Longest Common Prefix](https://leetcode.com/problems/longest-common-prefix/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_14.java) | [:tv:](https://www.youtube.com/watch?v=K1ps6d7YCy4) | Easy @@ -810,6 +810,6 @@ | 6 | [ZigZag Conversion](https://leetcode.com/problems/zigzag-conversion/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_6.java) | | Easy | | 5 | [Longest Palindromic Substring](https://leetcode.com/problems/longest-palindromic-substring/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_5.java) | | Medium | | 4 | [Median of Two Sorted Arrays](https://leetcode.com/problems/median-of-two-sorted-arrays/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_4.java), [C++](../master/cpp/_4.cpp) | | Hard | Divide and Conquer -| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_3.java), [C++](../master/cpp/_3.cpp), [Javascript](https://github.com/sambabib/Leetcode/blob/sambabib-js-solutions/javascript/_3.js) | | Medium | HashMap, Sliding Window +| 3 | [Longest Substring Without Repeating Characters](https://leetcode.com/problems/longest-substring-without-repeating-characters/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_3.java), [C++](../master/cpp/_3.cpp), [Javascript](https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_3.js) | | Medium | HashMap, Sliding Window | 2 | [Add Two Numbers](https://leetcode.com/problems/add-two-numbers/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_2.java) | | Medium | LinkedList | 1 | [Two Sum](https://leetcode.com/problems/two-sum/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_1.java), [C++](../master/cpp/_1.cpp), [Javascript](../master/javascript/_1.js) | [:tv:](https://www.youtube.com/watch?v=kPXOr6pW8KM&t=) | Easy | HashMap \ No newline at end of file From 7a35db860d9a5fc0fc580f80a55f67311805e766 Mon Sep 17 00:00:00 2001 From: sambabib Date: Fri, 3 Jan 2025 05:58:17 +0000 Subject: [PATCH 5/8] added js solution 994 --- javascript/_994.js | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 javascript/_994.js diff --git a/javascript/_994.js b/javascript/_994.js new file mode 100644 index 0000000000..67ab649ddd --- /dev/null +++ b/javascript/_994.js @@ -0,0 +1,57 @@ +function orangesRotting(grid) { + const rows = grid.length; + const cols = grid[0].length; + let queue = []; + let freshOranges = 0; + + // Initialize the queue with all rotten oranges and count fresh oranges + for (let r = 0; r < rows; r++) { + for (let c = 0; c < cols; c++) { + if (grid[r][c] === 2) { + queue.push([r, c]); + } else if (grid[r][c] === 1) { + freshOranges++; + } + } + } + + // If there are no fresh oranges, return 0 + if (freshOranges === 0) return 0; + + let minutes = 0; + const directions = [ + [0, 1], // right + [1, 0], // down + [0, -1], // left + [-1, 0] // up + ]; + + // Step 2: Perform BFS + while (queue.length > 0) { + let size = queue.length; + let newRotten = false; + + for (let i = 0; i < size; i++) { + let [x, y] = queue.shift(); + + for (let [dx, dy] of directions) { + let nx = x + dx; + let ny = y + dy; + + // Check if the neighboring cell is a fresh orange + if (nx >= 0 && ny >= 0 && nx < rows && ny < cols && grid[nx][ny] === 1) { + grid[nx][ny] = 2; // Make it rotten + freshOranges--; // Decrease count of fresh oranges + queue.push([nx, ny]); // Add it to the queue + newRotten = true; + } + } + } + + // If rotten oranges exist, increment minutes + if (newRotten) minutes++; + } + + // Check if there are any fresh oranges left + return freshOranges === 0 ? minutes : -1; +} From 83fdb18e624c5ec38880ba063fd0c2fcf88e7748 Mon Sep 17 00:00:00 2001 From: sambabib Date: Sun, 5 Jan 2025 15:35:32 +0000 Subject: [PATCH 6/8] added solution link to readme --- paginated_contents/algorithms/1st_thousand/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paginated_contents/algorithms/1st_thousand/README.md b/paginated_contents/algorithms/1st_thousand/README.md index 24e367d524..2979301b84 100644 --- a/paginated_contents/algorithms/1st_thousand/README.md +++ b/paginated_contents/algorithms/1st_thousand/README.md @@ -4,7 +4,7 @@ | 991 | [Broken Calculator](https://leetcode.com/problems/broken-calculator/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_991.java) | | Medium | Math, Greedy | 981 | [Time Based Key-Value Store](https://leetcode.com/problems/time-based-key-value-store/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_981.java) | [:tv:](https://youtu.be/eVi4gDimCoo) | Medium | | 997 | [Find the Town Judge](https://leetcode.com/problems/find-the-town-judge/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_997.java) | | Easy | -| 994 | [Rotting Oranges](https://leetcode.com/problems/rotting-oranges/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_994.java) | | Medium | BFS +| 994 | [Rotting Oranges](https://leetcode.com/problems/rotting-oranges/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_994.java) [Javascript](https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_994.js) | | Medium | BFS | 993 | [Cousins in Binary Tree](https://leetcode.com/problems/cousins-in-binary-tree/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_993.java) | | Easy | Tree, BFS | 989 | [Add to Array-Form of Integer](https://leetcode.com/problems/add-to-array-form-of-integer/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_989.java) | | Easy | Array | 988 | [Smallest String Starting From Leaf](https://leetcode.com/problems/smallest-string-starting-from-leaf/) | [Solution](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/firstthousand/_988.java) | | Medium | Tree, DFS From b7dc87f5361c19635480dc37725d73631876f9a6 Mon Sep 17 00:00:00 2001 From: sambabib Date: Thu, 6 Feb 2025 01:29:19 +0000 Subject: [PATCH 7/8] added js solutions to _3016 && _3175 --- javascript/_3016.js | 24 ++++++++++++++++++ javascript/_3175.js | 25 +++++++++++++++++++ .../algorithms/4th_thousand/README.md | 4 +-- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 javascript/_3016.js create mode 100644 javascript/_3175.js diff --git a/javascript/_3016.js b/javascript/_3016.js new file mode 100644 index 0000000000..b031efde5a --- /dev/null +++ b/javascript/_3016.js @@ -0,0 +1,24 @@ +function minPushesToType(word) { + let freqMap = new Map(); + + // Using greedy frequency-based allocation (this is basically gives pirority based on frequenecy of occurence.). + // Count frequency of each letter. + for (let char of word) { + freqMap.set(char, (freqMap.get(char) || 0) + 1); + } + + // Sort letters by frequency in descending order. + let frequencies = Array.from(freqMap.values()).sort((a, b) => b - a); + + // Assign letters to keys 2-9. + let keys = Array(8).fill(0); + let totalPushes = 0; + + for (let i = 0; i < frequencies.length; i++) { + let keyIndex = i % 8; + let presses = Math.floor(i / 8) + 1; + totalPushes += frequencies[i] * presses; + } + + return totalPushes; +} diff --git a/javascript/_3175.js b/javascript/_3175.js new file mode 100644 index 0000000000..6a223a0940 --- /dev/null +++ b/javascript/_3175.js @@ -0,0 +1,25 @@ +function findWinner(skills, k) { + // This solution uses a queue to process the matches. + let n = skills.length; + let maxSkill = Math.max(...skills); + let queue = []; + + let currentWinner = 0; + let currentWins = 0; + + for (let i = 1; i < n; i++) { + if (skills[currentWinner] > skills[i]) { + currentWins++; + } else { + currentWinner = i; + currentWins = 1; + } + + // If the champion has won k times or is the max skill player, return. + if (currentWins >= k || skills[currentWinner] === maxSkill) { + return currentWinner; + } + } + + return currentWinner; +} diff --git a/paginated_contents/algorithms/4th_thousand/README.md b/paginated_contents/algorithms/4th_thousand/README.md index 371b22f181..787eb0ef15 100644 --- a/paginated_contents/algorithms/4th_thousand/README.md +++ b/paginated_contents/algorithms/4th_thousand/README.md @@ -42,7 +42,7 @@ | 3185 | [Count Pairs That Form a Complete Day II](https://leetcode.com/problems/count-pairs-that-form-a-complete-day-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3185.java) | | Medium | | 3184 | [Count Pairs That Form a Complete Day I](https://leetcode.com/problems/count-pairs-that-form-a-complete-day-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3184.java) | | Easy | | 3178 | [Find the Child Who Has the Ball After K Seconds](https://leetcode.com/problems/find-the-child-who-has-the-ball-after-k-seconds/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3178.java) | | Easy | -| 3175 | [Find The First Player to win K Games in a Row](https://leetcode.com/problems/find-the-first-player-to-win-k-games-in-a-row/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3175.java) | | Medium | +| 3175 | [Find The First Player to win K Games in a Row](https://leetcode.com/problems/find-the-first-player-to-win-k-games-in-a-row/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3175.java) | [Javascript](https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_3175.js) | Medium | | 3174 | [Clear Digits](https://leetcode.com/problems/clear-digits/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3174.java) | | Easy | | 3173 | [Bitwise OR of Adjacent Elements](https://leetcode.com/problems/bitwise-or-of-adjacent-elements/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3173.java) | | Easy | | 3168 | [Minimum Number of Chairs in a Waiting Room](https://leetcode.com/problems/minimum-number-of-chairs-in-a-waiting-room/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3168.java) | | Easy | @@ -78,7 +78,7 @@ | 3024 | [Type of Triangle](https://leetcode.com/problems/type-of-triangle/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3024.java) | | Easy | | 3028 | [Ant on the Boundary](https://leetcode.com/problems/ant-on-the-boundary/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3028.java) | | Easy | | 3019 | [Number of Changing Keys](https://leetcode.com/problems/number-of-changing-keys/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3019.java) | | Easy | -| 3016 | [Minimum Number of Pushes to Type Word II](https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3016.java) | | Medium | +| 3016 | [Minimum Number of Pushes to Type Word II](https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3016.java) | [Javascript](https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_3016.js) | Medium | | 3010 | [Divide an Array Into Subarrays With Minimum Cost I](https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3010.java) | | Easy | | 3014 | [Minimum Number of Pushes to Type Word I](https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3014.java) | | Easy | | 3006 | [Find Beautiful Indices in the Given Array I](https://leetcode.com/problems/find-beautiful-indices-in-the-given-array-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3006.java) | | Medium | From 423eb1103a53a99149c4ec8b74fb5e535e7eb7a5 Mon Sep 17 00:00:00 2001 From: sambabib Date: Tue, 1 Apr 2025 03:32:52 +0100 Subject: [PATCH 8/8] Revert changes to README.md --- .../algorithms/4th_thousand/README.md | 113 +++++++----------- 1 file changed, 41 insertions(+), 72 deletions(-) diff --git a/paginated_contents/algorithms/4th_thousand/README.md b/paginated_contents/algorithms/4th_thousand/README.md index 89d4630c79..787eb0ef15 100644 --- a/paginated_contents/algorithms/4th_thousand/README.md +++ b/paginated_contents/algorithms/4th_thousand/README.md @@ -1,50 +1,25 @@ | # | Title | Solutions | Video | Difficulty | Tag |------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|------------|---------------------------------------------------------------------- -| 3471 | [Find the Largest Almost Missing Integer](https://leetcode.com/problems/find-the-largest-almost-missing-integer/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3471.java) | | Easy | -| 3396 | [Minimum Number of Operations to Make Elements in Array Distinct](https://leetcode.com/problems/minimum-number-of-operations-to-make-elements-in-array-distinct/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3396.java) | | Easy | -| 3392 | [Count Subarrays of Length Three With a Condition](https://leetcode.com/problems/count-subarrays-of-length-three-with-a-condition/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3392.java) | | Easy | -| 3386 | [Button with Longest Push Time](https://leetcode.com/problems/button-with-longest-push-time/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3386.java) | | Easy | -| 3379 | [Transformed Array](https://leetcode.com/problems/transformed-array/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3379.java) | | Easy | -| 3375 | [Minimum Operations to Make Array Values Equal to K](https://leetcode.com/problems/minimum-operations-to-make-array-values-equal-to-k/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3375.java) | | Easy | -| 3370 | [Smallest Number With All Set Bits](https://leetcode.com/problems/smallest-number-with-all-set-bits/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3370.java) | | Easy | -| 3364 | [Minimum Positive Sum Subarray](https://leetcode.com/problems/minimum-positive-sum-subarray/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3364.java) | | Easy | -| 3360 | [Stone Removal Game](https://leetcode.com/problems/stone-removal-game/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3360.java) | | Easy | -| 3354 | [Make Array Elements Equal to Zero](https://leetcode.com/problems/make-array-elements-equal-to-zero/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3354.java) | | Easy | -| 3353 | [Minimum Total Operations](https://leetcode.com/problems/minimum-total-operations/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3353.java) | | Easy | -| 3349 | [Adjacent Increasing Subarrays Detection I](https://leetcode.com/problems/adjacent-increasing-subarrays-detection-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3349.java) | | Easy | -| 3345 | [Smallest Divisible Digit Product I](https://leetcode.com/problems/smallest-divisible-digit-product-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3345.java) | | Easy | -| 3340 | [Check Balanced String](https://leetcode.com/problems/check-balanced-string/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3340.java) | | Easy | -| 3330 | [Find the Original Typed String I](https://leetcode.com/problems/find-the-original-typed-string-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3330.java) | | Easy | -| 3324 | [Find the Sequence of Strings Appeared on the Screen](https://leetcode.com/problems/find-the-sequence-of-strings-appeared-on-the-screen/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3324.java) | | Easy | -| 3318 | [Find X-Sum of All K-Long Subarrays I](https://leetcode.com/problems/find-x-sum-of-all-k-long-subarrays-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3318.java) | | Easy | -| 3314 | [Construct the Minimum Bitwise Array I](https://leetcode.com/problems/construct-the-minimum-bitwise-array-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3314.java) | | Easy | -| 3304 | [Find the K-th Character in String Game I](https://leetcode.com/problems/find-the-k-th-character-in-string-game-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3304.java) | | Easy | -| 3300 | [Minimum Element After Replacement With Digit Sum](https://leetcode.com/problems/minimum-element-after-replacement-with-digit-sum/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3300java) | | Easy | -| 3289 | [The Two Sneaky Numbers of Digitville](https://leetcode.com/problems/the-two-sneaky-numbers-of-digitville/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3289.java) | | Easy | -| 3285 | [Find Indices of Stable Mountains](https://leetcode.com/problems/find-indices-of-stable-mountains/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3285.java) | | Easy | -| 3280 | [Convert Date to Binary](https://leetcode.com/problems/convert-date-to-binary/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3280.java) | | Easy | -| 3274 | [Check if Two Chessboard Squares Have the Same Color](https://leetcode.com/problems/check-if-two-chessboard-squares-have-the-same-color/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3274.java) | | Easy | -| 3270 | [Find the Key of the Numbers](https://leetcode.com/problems/find-the-key-of-the-numbers/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3270.java) | | Easy | -| 3264 | [Final Array State After K Multiplication Operations I](https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3264.java) | | Easy | -| 3263 | [Convert Doubly Linked List to Array I](https://leetcode.com/problems/convert-doubly-linked-list-to-array-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3263.java) | | Easy | -| 3258 | [Count Substrings That Satisfy K-Constraint I](https://leetcode.com/problems/count-substrings-that-satisfy-k-constraint-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3258.java) | | Easy | -| 3254 | [Find the Power of K-Size Subarrays I](https://leetcode.com/problems/find-the-power-of-k-size-subarrays-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3254.java) | | Easy | -| 3249 | [Count the Number of Good Nodes](https://leetcode.com/problems/count-the-number-of-good-nodes/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3249.java) | | Medium | -| 3248 | [Snake in Matrix](https://leetcode.com/problems/snake-in-matrix/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3248.java) | | Easy | -| 3243 | [Shortest Distance After Road Addition Queries I](https://leetcode.com/problems/shortest-distance-after-road-addition-queries-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3243.java) | | Medium | -| 3242 | [Design Neighbor Sum Service](https://leetcode.com/problems/design-neighbor-sum-service/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3242.java) | | Easy | -| 3241 | [Time Taken to Mark All Nodes](https://leetcode.com/problems/time-taken-to-mark-all-nodes/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3241.java) | | Hard | -| 3240 | [Minimum Number of Flips to Make Binary Grid Palindromic II](https://leetcode.com/problems/minimum-number-of-flips-to-make-binary-grid-palindromic-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3240.java) | | Medium | -| 3239 | [Minimum Number of Flips to Make Binary Grid Palindromic I](https://leetcode.com/problems/minimum-number-of-flips-to-make-binary-grid-palindromic-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3239.java) | | Easy | -| 3238 | [Find the Number of Winning Players](https://leetcode.com/problems/find-the-number-of-winning-players/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3238.java) | | Easy | -| 3237 | [Alt and Tab Simulation](https://leetcode.com/problems/alt-and-tab-simulation/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3237.java) | | Medium | -| 3234 | [Count the Number of Substrings With Dominant Ones](https://leetcode.com/problems/count-the-number-of-substrings-with-dominant-ones/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3234.java) | | Medium | Sliding Window -| 3233 | [Find the Count of Numbers Which Are Not Special](https://leetcode.com/problems/find-the-count-of-numbers-which-are-not-special/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3233.java) | | Medium | Math -| 3232 | [Find if Digit Game Can Be Won](https://leetcode.com/problems/find-if-digit-game-can-be-won/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3232.java) | | Easy | -| 3226 | [Number of Bit Changes to Make Two Integers Equal](https://leetcode.com/problems/number-of-bit-changes-to-make-two-integers-equal/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3226.java) | | Easy | -| 3224 | [Minimum Array Changes to Make Differences Equal](https://leetcode.com/problems/minimum-array-changes-to-make-differences-equal/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3224.java) | | Medium | -| 3223 | [Minimum Length of String After Operations](https://leetcode.com/problems/minimum-length-of-string-after-operations/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3223.java) | | Medium | -| 3222 | [Find the Winning Player in Coin Game](https://leetcode.com/problems/find-the-winning-player-in-coin-game/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3222.java) | | Easy | +| 3264 | [Final Array State After K Multiplication Operations I](https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3264.java) | | Easy | +| 3263 | [Convert Doubly Linked List to Array I](https://leetcode.com/problems/convert-doubly-linked-list-to-array-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3263.java) | | Easy | +| 3258 | [Count Substrings That Satisfy K-Constraint I](https://leetcode.com/problems/count-substrings-that-satisfy-k-constraint-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3258.java) | | Easy | +| 3254 | [Find the Power of K-Size Subarrays I](https://leetcode.com/problems/find-the-power-of-k-size-subarrays-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3254.java) | | Easy | +| 3249 | [Count the Number of Good Nodes](https://leetcode.com/problems/count-the-number-of-good-nodes/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3249.java) | | Medium | +| 3248 | [Snake in Matrix](https://leetcode.com/problems/snake-in-matrix/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3248.java) | | Easy | +| 3243 | [Shortest Distance After Road Addition Queries I](https://leetcode.com/problems/shortest-distance-after-road-addition-queries-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3243.java) | | Medium | +| 3242 | [Design Neighbor Sum Service](https://leetcode.com/problems/design-neighbor-sum-service/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3242.java) | | Easy | +| 3241 | [Time Taken to Mark All Nodes](https://leetcode.com/problems/time-taken-to-mark-all-nodes/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3241.java) | | Hard | +| 3240 | [Minimum Number of Flips to Make Binary Grid Palindromic II](https://leetcode.com/problems/minimum-number-of-flips-to-make-binary-grid-palindromic-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3240.java) | | Medium | +| 3239 | [Minimum Number of Flips to Make Binary Grid Palindromic I](https://leetcode.com/problems/minimum-number-of-flips-to-make-binary-grid-palindromic-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3239.java) | | Easy | +| 3238 | [Find the Number of Winning Players](https://leetcode.com/problems/find-the-number-of-winning-players/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3238.java) | | Easy | +| 3237 | [Alt and Tab Simulation](https://leetcode.com/problems/alt-and-tab-simulation/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3237.java) | | Medium | +| 3234 | [Count the Number of Substrings With Dominant Ones](https://leetcode.com/problems/count-the-number-of-substrings-with-dominant-ones/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3234.java) | | Medium | Sliding Window +| 3233 | [Find the Count of Numbers Which Are Not Special](https://leetcode.com/problems/find-the-count-of-numbers-which-are-not-special/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3233.java) | | Medium | Math +| 3232 | [Find if Digit Game Can Be Won](https://leetcode.com/problems/find-if-digit-game-can-be-won/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3232.java) | | Easy | +| 3226 | [Number of Bit Changes to Make Two Integers Equal](https://leetcode.com/problems/number-of-bit-changes-to-make-two-integers-equal/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3226.java) | | Easy | +| 3224 | [Minimum Array Changes to Make Differences Equal](https://leetcode.com/problems/minimum-array-changes-to-make-differences-equal/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3224.java) | | Medium | +| 3223 | [Minimum Length of String After Operations](https://leetcode.com/problems/minimum-length-of-string-after-operations/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3223.java) | | Medium | +| 3222 | [Find the Winning Player in Coin Game](https://leetcode.com/problems/find-the-winning-player-in-coin-game/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3222.java) | | Easy | | 3219 | [Minimum Cost for Cutting Cake II](https://leetcode.com/problems/minimum-cost-for-cutting-cake-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3219.java) | | Hard | Greedy | 3218 | [Minimum Cost for Cutting Cake I](https://leetcode.com/problems/minimum-cost-for-cutting-cake-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3218.java) | | Medium | | 3217 | [Delete Nodes From Linked List Present in Array](https://leetcode.com/problems/delete-nodes-from-linked-list-present-in-array/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3217.java) | | Medium | LinkedList @@ -70,49 +45,43 @@ | 3175 | [Find The First Player to win K Games in a Row](https://leetcode.com/problems/find-the-first-player-to-win-k-games-in-a-row/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3175.java) | [Javascript](https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_3175.js) | Medium | | 3174 | [Clear Digits](https://leetcode.com/problems/clear-digits/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3174.java) | | Easy | | 3173 | [Bitwise OR of Adjacent Elements](https://leetcode.com/problems/bitwise-or-of-adjacent-elements/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3173.java) | | Easy | -| 3168 | [Minimum Number of Chairs in a Waiting Room](https://leetcode.com/problems/minimum-number-of-chairs-in-a-waiting-room/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3168.java) | | Easy | +| 3168 | [Minimum Number of Chairs in a Waiting Room](https://leetcode.com/problems/minimum-number-of-chairs-in-a-waiting-room/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3168.java) | | Easy | | 3164 | [Find the Number of Good Pairs II](https://leetcode.com/problems/find-the-number-of-good-pairs-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3164.java) | | Medium | | 3162 | [Find the Number of Good Pairs I](https://leetcode.com/problems/find-the-number-of-good-pairs-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3162.java) | | Easy | -| 3158 | [Find the XOR of Numbers Which Appear Twice](https://leetcode.com/problems/find-the-xor-of-numbers-which-appear-twice/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3158.java) | | Easy | +| 3158 | [Find the XOR of Numbers Which Appear Twice](https://leetcode.com/problems/find-the-xor-of-numbers-which-appear-twice/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3158.java) | | Easy | | 3157 | [Find the Level of Tree with Minimum Sum](https://leetcode.com/problems/find-the-level-of-tree-with-minimum-sum/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3157.java) | | Medium |BFS -| 3151 | [Special Array I](https://leetcode.com/problems/special-array-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3151.java) | | Easy | -| 3146 | [Permutation Difference between Two Strings](https://leetcode.com/problems/permutation-difference-between-two-strings/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3146.java) | | Easy | +| 3151 | [Special Array I](https://leetcode.com/problems/special-array-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3151.java) | | Easy | +| 3146 | [Permutation Difference between Two Strings](https://leetcode.com/problems/permutation-difference-between-two-strings/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3146.java) | | Easy | | 3142 | [Check if Grid Satisfies Conditions](https://leetcode.com/problems/check-if-grid-satisfies-conditions/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3142.java) | | Easy | -| 3136 | [Valid Word](https://leetcode.com/problems/valid-word/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3136.java) | | Easy | +| 3136 | [Valid Word](https://leetcode.com/problems/valid-word/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3136.java) | | Easy | | 3131 | [Find the Integer Added to Array I](https://leetcode.com/problems/find-the-integer-added-to-array-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3131.java) | | Easy | | 3127 | [Make a Square with the Same Color](https://leetcode.com/problems/make-a-square-with-the-same-color/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3127.java) | | Easy | | 3120 | [Count the Number of Special Characters I](https://leetcode.com/problems/count-the-number-of-special-characters-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3120.java) | | Easy | -| 3114 | [Latest Time You Can Obtain After Replacing Characters](https://leetcode.com/problems/latest-time-you-can-obtain-after-replacing-characters/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3114.java) | | Easy | -| 3112 | [Minimum Time to Visit Disappearing Nodes](https://leetcode.com/problems/minimum-time-to-visit-disappearing-nodes/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3112.java) | | Medium | Graph, Shortest Path +| 3114 | [Latest Time You Can Obtain After Replacing Characters](https://leetcode.com/problems/latest-time-you-can-obtain-after-replacing-characters/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3114.java) | | Easy | +| 3112 | [Minimum Time to Visit Disappearing Nodes](https://leetcode.com/problems/minimum-time-to-visit-disappearing-nodes/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3112.java) | | Medium | Graph, Shortest Path | 3110 | [Score of a String](https://leetcode.com/problems/score-of-a-string/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3110.java) | | Easy | -| 3099 | [Harshad Number](https://leetcode.com/problems/harshad-number/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3099.java) | | Easy | +| 3099 | [Harshad Number](https://leetcode.com/problems/harshad-number/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3099.java) | | Easy | | 3095 | [Shortest Subarray With OR at Least K I](https://leetcode.com/problems/shortest-subarray-with-or-at-least-k-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3095.java) | | Easy | | 3090 | [Maximum Length Substring With Two Occurrences](https://leetcode.com/problems/maximum-length-substring-with-two-occurrences/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3090.java) | | Easy | -| 3083 | [Existence of a Substring in a String and Its Reverse](https://leetcode.com/problems/existence-of-a-substring-in-a-string-and-its-reverse/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3083.java) | | Easy | -| 3079 | [Find the Sum of Encrypted Integers](https://leetcode.com/problems/find-the-sum-of-encrypted-integers/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3079.java) | | Easy | +| 3083 | [Existence of a Substring in a String and Its Reverse](https://leetcode.com/problems/existence-of-a-substring-in-a-string-and-its-reverse/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3083.java) | | Easy | +| 3079 | [Find the Sum of Encrypted Integers](https://leetcode.com/problems/find-the-sum-of-encrypted-integers/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3079.java) | | Easy | | 3074 | [Apple Redistribution into Boxes](https://leetcode.com/problems/apple-redistribution-into-boxes/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3074.java) | | Easy | -| 3069 | [Distribute Elements Into Two Arrays I](https://leetcode.com/problems/distribute-elements-into-two-arrays-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3069.java) | | Easy | -| 3065 | [Minimum Operations to Exceed Threshold Value I](https://leetcode.com/problems/minimum-operations-to-exceed-threshold-value-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3065.java) | | Easy | -| 3063 | [Linked List Frequency](https://leetcode.com/problems/linked-list-frequency/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3063.java) | | Easy | +| 3069 | [Distribute Elements Into Two Arrays I](https://leetcode.com/problems/distribute-elements-into-two-arrays-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3069.java) | | Easy | +| 3065 | [Minimum Operations to Exceed Threshold Value I](https://leetcode.com/problems/minimum-operations-to-exceed-threshold-value-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3065.java) | | Easy | +| 3063 | [Linked List Frequency](https://leetcode.com/problems/linked-list-frequency/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3063.java) | | Easy | | 3062 | [Winner of the Linked List Game](https://leetcode.com/problems/winner-of-the-linked-list-game/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3062.java) | | Easy | | 3046 | [Split the Array](https://leetcode.com/problems/split-the-array/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3046.java) | | Easy | | 3042 | [Count Prefix and Suffix Pairs I](https://leetcode.com/problems/count-prefix-and-suffix-pairs-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3042.java) | | Easy | | 3038 | [Maximum Number of Operations With the Same Score I](https://leetcode.com/problems/maximum-number-of-operations-with-the-same-score-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3038.java) | | Easy | | 3033 | [Modify the Matrix](https://leetcode.com/problems/modify-the-matrix/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3033.java) | | Easy | -| 3032 | [Count Numbers With Unique Digits II](https://leetcode.com/problems/count-numbers-with-unique-digits-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3032.java) | | Easy | -| 3024 | [Type of Triangle](https://leetcode.com/problems/type-of-triangle/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3024.java) | | Easy | -| 3028 | [Ant on the Boundary](https://leetcode.com/problems/ant-on-the-boundary/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3028.java) | | Easy | -| 3019 | [Number of Changing Keys](https://leetcode.com/problems/number-of-changing-keys/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3019.java) | | Easy | -| 3016 | [Minimum Number of Pushes to Type Word II](https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3016.java) | [Javascript](https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_3016.js) | Medium | -| 3010 | [Divide an Array Into Subarrays With Minimum Cost I](https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3010.java) | | Easy | -| 3032 | [Count Numbers With Unique Digits II](https://leetcode.com/problems/count-numbers-with-unique-digits-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3032.java) | | Easy | -| 3024 | [Type of Triangle](https://leetcode.com/problems/type-of-triangle/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3024.java) | | Easy | -| 3028 | [Ant on the Boundary](https://leetcode.com/problems/ant-on-the-boundary/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3028.java) | | Easy | -| 3019 | [Number of Changing Keys](https://leetcode.com/problems/number-of-changing-keys/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3019.java) | | Easy | -| 3016 | [Minimum Number of Pushes to Type Word II](https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3016.java) | | Medium | -| 3010 | [Divide an Array Into Subarrays With Minimum Cost I](https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3010.java) | | Easy | +| 3032 | [Count Numbers With Unique Digits II](https://leetcode.com/problems/count-numbers-with-unique-digits-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3032.java) | | Easy | +| 3024 | [Type of Triangle](https://leetcode.com/problems/type-of-triangle/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3024.java) | | Easy | +| 3028 | [Ant on the Boundary](https://leetcode.com/problems/ant-on-the-boundary/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3028.java) | | Easy | +| 3019 | [Number of Changing Keys](https://leetcode.com/problems/number-of-changing-keys/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3019.java) | | Easy | +| 3016 | [Minimum Number of Pushes to Type Word II](https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-ii/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3016.java) | [Javascript](https://github.com/fishercoder1534/Leetcode/blob/master/javascript/_3016.js) | Medium | +| 3010 | [Divide an Array Into Subarrays With Minimum Cost I](https://leetcode.com/problems/divide-an-array-into-subarrays-with-minimum-cost-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3010.java) | | Easy | | 3014 | [Minimum Number of Pushes to Type Word I](https://leetcode.com/problems/minimum-number-of-pushes-to-type-word-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3014.java) | | Easy | | 3006 | [Find Beautiful Indices in the Given Array I](https://leetcode.com/problems/find-beautiful-indices-in-the-given-array-i/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3006.java) | | Medium | | 3005 | [Count Elements With Maximum Frequency](https://leetcode.com/problems/count-elements-with-maximum-frequency/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3005.java) | | Easy | -| 3004 | [Maximum Subtree of the Same Color](https://leetcode.com/problems/maximum-subtree-of-the-same-color/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3004.java) | | Medium | DFS, Tree -| 3000 | [Maximum Area of Longest Diagonal Rectangle](https://leetcode.com/problems/maximum-area-of-longest-diagonal-rectangle/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3000.java) | | Easy | +| 3004 | [Maximum Subtree of the Same Color](https://leetcode.com/problems/maximum-subtree-of-the-same-color/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3004.java) | | Medium | DFS, Tree +| 3000 | [Maximum Area of Longest Diagonal Rectangle](https://leetcode.com/problems/maximum-area-of-longest-diagonal-rectangle/) | [Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3000.java) | | Easy |