MCPcopy Create free account

hub / github.com/Hsinha11/Leetcode-solutions / functions

Functions798 in github.com/Hsinha11/Leetcode-solutions

MethodisSafe
-51-N_Queens/Code.cpp:3
MethodisSameTree
(s, t)
-572-subtree-of-another-tree/-572-subtree-of-another-tree.py:11
MethodisSubsequence
(self, s: str, t: str)
392-is-subsequence/is-subsequence.py:2
MethodisSymmetric
(self, root: Optional[TreeNode])
101-symmetric-tree/symmetric-tree.py:8
MethodisValid
(self, s: str)
20-valid-parentheses/valid-parentheses.py:2
MethodisValid
37-sudoku-solver/sudoku-solver.cpp:30
MethodisValidBST
(self, root: Optional[TreeNode])
98-validate-binary-search-tree/validate-binary-search-tree.py:12
MethodisValidSudoku
(self, board: list[list[str]])
36-Valid-Sudoku/36-Valid-Sudoku.py:2
MethodisValidSudoku
36-Valid-Sudoku/36-Valid-Sudoku.cpp:6
Methodis_palindrome
(substring, left, right)
131-Palindrome-Partitioning/palindromeparitioning.py:25
MethodislandPerimeter
463-Island-Perimeter/solution.cpp:4
MethodislandPerimeter
(int[][] grid)
463-Island-Perimeter/Solution.java:3
Methodislower
420-strong-password-checker/strong-password-checker.cpp:25
Methodisupper
420-strong-password-checker/strong-password-checker.cpp:29
MethodjudgeCircle
(self, moves: str)
657-robot-return-to-origin/robot-return-to-origin.py:2
MethodkLengthApart
(self, nums: List[int], k: int)
1548-check-if-all-1s-are-at-least-length-k-places-away/check-if-all-1s-are-at-least-length-k-places-away.py:2
MethodkthCharacter
(self, k: int)
3600-find-the-k-th-character-in-string-game-i/find-the-k-th-character-in-string-game-i.py:2
MethodkthDistinct
(self, arr: List[str], k: int)
2163-kth-distinct-string-in-an-array/kth-distinct-string-in-an-array.py:2
MethodkthDistinct
2163-kth-distinct-string-in-an-array/kth-distinct-string-in-an-array.cpp:3
MethodkthLargestLevelSum
(self, root: Optional[TreeNode], k: int)
2646-kth-largest-sum-in-a-binary-tree/kth-largest-sum-in-a-binary-tree.py:8
MethodkthSmallestPrimeFraction
(self, arr: List[int], k: int)
802-k-th-smallest-prime-fraction/k-th-smallest-prime-fraction.py:3
MethodladderLength
(self, beginWord: str, endWord: str, wordList: List[str])
127-word-ladder/word-ladder.py:5
MethodlargestGoodInteger
(self, num: str)
2346-largest-3-same-digit-number-in-string/largest-3-same-digit-number-in-string.py:2
MethodlargestGoodInteger
2264-largest-3-same-digit-number/largest-3-same-digit.cpp:6
MethodlargestNumber
(self, nums: List[int])
179-largest-number/largest-number.py:5
MethodlargestOddNumber
1903-largest-odd-number-in-string/largest-odd-number.cpp:6
MethodlargestOddNumber
Alternative implementation using enumerate and next() function.
1903-largest-odd-number-in-string/largest-odd-number-in-string.py:39
MethodlargestPerimeter
(self, nums: List[int])
1018-largest-perimeter-triangle/largest-perimeter-triangle.py:2
MethodlargestRectangleArea
84-largest-rectangle-in-histogram/largest-rectangle-in-histogram.cpp:3
MethodlargestRectangleArea
(self, heights: list[int])
84-largest-rectangle-in-histogram/largest-rectangle-in-histogram.py:2
MethodlargestSumAfterKNegations
(self, nums: List[int], k: int)
1047-maximize-sum-of-array-after-k-negations/maximize-sum-of-array-after-k-negations.py:2
MethodlcaDeepestLeaves
(self, root: Optional[TreeNode])
1218-lowest-common-ancestor-of-deepest-leaves/lowest-common-ancestor-of-deepest-leaves.py:8
Methodlcm
(a, b)
2307-replace-non-coprime-numbers-in-array/replace-non-coprime-numbers-in-array.py:4
MethodleastInterval
(self, tasks: List[str], n: int)
621-task-scheduler/task-scheduler.py:2
MethodleftRightDifference
(self, nums: List[int])
2714-left-and-right-sum-differences/left-and-right-sum-differences.py:2
MethodlengthAfterTransformations
(self, s: str, t: int)
3335-Total-Characters-in-String-After-Transformations/Total-Characters-in-String-After-Transformations.py:2
FunctionlengthOfLIS
(nums)
300-longest-increasing-subsequence/longest-increasing-subsequence.js:7
MethodlengthOfLIS
(self, nums: List[int])
300-longest-increasing-subsequence/longest-increasing-subsequence.py:7
MethodlengthOfLIS
(int[] nums)
300-longest-increasing-subsequence/longest-increasing-subsequence.java:6
MethodlengthOfLastWord
(String s)
58-length-of-last-word/Solution.java:2
MethodlengthOfLongestSubsequence
(self, nums: List[int], target: int)
3106-length-of-the-longest-subsequence-that-sums-to-target/length-of-the-longest-subsequence-that-sums-to-target.py:4
FunctionlengthOfLongestSubstring
(s)
3-Longest-Substring-Without-Repeating-Characters/longest-substring-without-repeating-characters.js:5
MethodlengthOfLongestSubstring
(self, s: str)
3-Longest-Substring-Without-Repeating-Characters/longest-substring-without-repeating-characters.py:2
MethodlengthOfLongestSubstring
(String s)
3-Longest-Substring-Without-Repeating-Characters/longest-substring-without-repeating-characters.java:5
MethodletterCombinations
(String digits)
17-letter-combination-of-a-phone-number/Solution.java:8
MethodlevelOrder
(self, root: Optional[TreeNode])
102-binary-tree-level-order-traversal/binary-tree-level-order-traversal.py:8
MethodlongestArithSeqLength
(self, nums: List[int])
1087-longest-arithmetic-subsequence/longest-arithmetic-subsequence.py:2
MethodlongestCommonPrefix
(self, strs)
14-longest-common-prefix/longest-common-prefix.py:2
FunctionlongestCommonSubsequence
(text1, text2)
1143-Longest-common-subsequence/longest-common-subsequence.js:8
MethodlongestCommonSubsequence
(self, text1: str, text2: str)
1143-Longest-common-subsequence/longest-common-subsequence.py:4
MethodlongestCommonSubsequence
(String text1, String text2)
1143-Longest-common-subsequence/longest-common-subsequence.java:4
MethodlongestCommonSubsequence
1143-Longest-common-subsequence/longest-common-subsequence.cpp:3
FunctionlongestConsecutive
(nums)
128-longest-consecutive-sequence/longest-consecutive-sequence.js:7
MethodlongestConsecutive
(int[] nums)
128-longest-consecutive-sequence/longest-consecutive-sequence.java:7
MethodlongestConsecutive
(self, nums: List[int])
128-longest-consecutive-sequence/longest-consecutive-sequence.py:6
MethodlongestOnes
(self, nums: List[int], k: int)
1046-max-consecutive-ones-iii/max-consecutive-ones-iii.py:2
MethodlongestSquareStreak
(self, nums: List[int])
2586-longest-square-streak-in-an-array/longest-square-streak-in-an-array.py:2
FunctionlongestSubarray
(nums)
1493. Longest Subarray of 1's After Deleting One Element/longest-subarray-of-1s-after-deleting-one -element.py:1
Functionmain
994-Rotting-Oranges/Rotting-Oranges.cpp:83
Functionmain
Helper main for quick local testing
22-generate-parentheses/generate-parentheses.cpp:33
Functionmain
417-PacificAtlanticWaterFlow/417-PacificAtlanticWaterFlow.cpp:62
Functionmain
-4-Median-Of-Two-Sorted-Arrays/-4-median_of_two_sorted_arrays.cpp:37
Functionmain
3704-count-no-zero-pairs-that-sum-to-n/3704-count-no-zero-pairs-that-sum-to-n.cpp:78
Functionmain
322_Coin_Change/322_Coin_Change.cpp:20
Functionmain
Example test
322_Coin_Change/217-contains-duplicate/contains-duplicate.cpp:24
Functionmain
Helper main for quick local testing
-242-Valid-Anagram/Valid_Anagram.cpp:20
Functionmain
Helper main for quick local testing
18-4sum/4sum.cpp:36
Functionmain
194-transpose-file/194-transpose-file.cpp:8
Functionmain
Example usage
3-Longest-Substring-Without-Repeating-Characters/Solution.cpp:24
Functionmain
2528-Maximize-the-Minimum-Powered-City/2528-Maximize-the-Minimum-Powered-City.cpp:75
Functionmain
3691-maximum-total-subarray-value-ii/3691-maximum-total-subarray-value-ii.cpp:271
Functionmain
189-Rotate-Array/189_Rotate_Array.cpp:27
Functionmain
local test
3347-maximum-frequency-of-an-element-after-performing-operations-ii/3347-maximum-frequency-of-an-element-after-performing-operations-ii.cpp:47
Functionmain
-68-Text_Justification/Code.cpp:57
Functionmain
Example main (local testing)
2286-booking-concert-tickets-in-groups/2286-booking-concert-tickets-in-groups.cpp:122
Functionmain
2472-maximum-number-of-non-overlapping-palindrome-substrings/2472-maximum-number-of-non-overlapping-palindrome-substrings.cpp:66
Functionmain
============================ Main Function (Example Test) ============================
MinimizeHammingDistance/MinimizeHammingDistance.cpp:76
Functionmain
Helper to run basic local tests (not used on LeetCode submission)
-2127-Maximum-Employee-to-be-invited-to-a-meeting/Maximum_Employee.cpp:68
Functionmain
Helper main for quick local testing
-118-Pascal's-triangle/pascals_triangle.cpp:21
Functionmain
Helper main for quick local testing
6.Zigzag-Conversion/zigzag-conversion.cpp:24
Functionmain
1493. Longest Subarray of 1's After Deleting One Element/longest-subarray-of-1s-after-deleting-one-element.cpp:36
Methodmain
(String[] args)
417-PacificAtlanticWaterFlow/417-PacificAtlanticWaterFlow.java:60
Methodmain
(String[] args)
3-Longest-Substring-Without-Repeating-Characters/Solution.java:20
Methodmain
(String[] args)
-68-Text_Justification/Code.java:54
MethodmajorityElement
229-majority-element-ii/majority-element-ii.cpp:3
MethodmakeFancyString
(self, s: str)
1302-delete-characters-to-make-fancy-string/delete-characters-to-make-fancy-string.py:2
MethodmapWordWeights
(self, words: List[str], weights: List[int])
4216-weighted-word-mapping/weighted-word-mapping.py:2
MethodmatchPlayersAndTrainers
(self, players: List[int], trainers: List[int])
2497-maximum-matching-of-players-with-trainers/maximum-matching-of-players-with-trainers.py:2
MethodmatrixReshape
(self, mat: List[List[int]], r: int, c: int)
566-reshape-the-matrix/reshape-the-matrix.py:2
FunctionmaxArea
(height)
11-container-with-most-water/container-with-most-water.js:7
MethodmaxArea
(int[] height)
11-container-with-most-water-leetcode/solution.java:2
MethodmaxArea
11-container-with-most-water-leetcode/solution.cpp:6
MethodmaxArea
(self, height: List[int])
11-container-with-most-water/container-with-most-water.py:6
MethodmaxArea
(int[] height)
11-container-with-most-water/container-with-most-water.java:4
MethodmaxBottlesDrunk
(self, numBottles: int, numexchange: int)
3336-water-bottles-ii/water-bottles-ii.py:2
MethodmaxDepth
(self, root: 'Node')
774-maximum-depth-of-n-ary-tree/maximum-depth-of-n-ary-tree.py:11
MethodmaxDepth
(self, root: Optional[TreeNode])
104-maximum-depth-of-binary-tree/maximum-depth-of-binary-tree.py:9
MethodmaxDistance
(self, moves: str)
4340-maximum-manhattan-distance-after-all-moves/maximum-manhattan-distance-after-all-moves.py:2
MethodmaxDistinct
(self, s: str)
4087-maximum-substrings-with-distinct-start/maximum-substrings-with-distinct-start.py:2
MethodmaxFreqSum
(self, s: str)
3872-find-most-frequent-vowel-and-consonant/find-most-frequent-vowel-and-consonant.py:2
← previousnext →401–500 of 798, ranked by callers