Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Hsinha11/Leetcode-solutions
/ functions
Functions
798 in github.com/Hsinha11/Leetcode-solutions
⨍
Functions
798
◇
Types & classes
539
Method
isSafe
-51-N_Queens/Code.cpp:3
Method
isSameTree
(s, t)
-572-subtree-of-another-tree/-572-subtree-of-another-tree.py:11
Method
isSubsequence
(self, s: str, t: str)
392-is-subsequence/is-subsequence.py:2
Method
isSymmetric
(self, root: Optional[TreeNode])
101-symmetric-tree/symmetric-tree.py:8
Method
isValid
(self, s: str)
20-valid-parentheses/valid-parentheses.py:2
Method
isValid
37-sudoku-solver/sudoku-solver.cpp:30
Method
isValidBST
(self, root: Optional[TreeNode])
98-validate-binary-search-tree/validate-binary-search-tree.py:12
Method
isValidSudoku
(self, board: list[list[str]])
36-Valid-Sudoku/36-Valid-Sudoku.py:2
Method
isValidSudoku
36-Valid-Sudoku/36-Valid-Sudoku.cpp:6
Method
is_palindrome
(substring, left, right)
131-Palindrome-Partitioning/palindromeparitioning.py:25
Method
islandPerimeter
463-Island-Perimeter/solution.cpp:4
Method
islandPerimeter
(int[][] grid)
463-Island-Perimeter/Solution.java:3
Method
islower
420-strong-password-checker/strong-password-checker.cpp:25
Method
isupper
420-strong-password-checker/strong-password-checker.cpp:29
Method
judgeCircle
(self, moves: str)
657-robot-return-to-origin/robot-return-to-origin.py:2
Method
kLengthApart
(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
Method
kthCharacter
(self, k: int)
3600-find-the-k-th-character-in-string-game-i/find-the-k-th-character-in-string-game-i.py:2
Method
kthDistinct
(self, arr: List[str], k: int)
2163-kth-distinct-string-in-an-array/kth-distinct-string-in-an-array.py:2
Method
kthDistinct
2163-kth-distinct-string-in-an-array/kth-distinct-string-in-an-array.cpp:3
Method
kthLargestLevelSum
(self, root: Optional[TreeNode], k: int)
2646-kth-largest-sum-in-a-binary-tree/kth-largest-sum-in-a-binary-tree.py:8
Method
kthSmallestPrimeFraction
(self, arr: List[int], k: int)
802-k-th-smallest-prime-fraction/k-th-smallest-prime-fraction.py:3
Method
ladderLength
(self, beginWord: str, endWord: str, wordList: List[str])
127-word-ladder/word-ladder.py:5
Method
largestGoodInteger
(self, num: str)
2346-largest-3-same-digit-number-in-string/largest-3-same-digit-number-in-string.py:2
Method
largestGoodInteger
2264-largest-3-same-digit-number/largest-3-same-digit.cpp:6
Method
largestNumber
(self, nums: List[int])
179-largest-number/largest-number.py:5
Method
largestOddNumber
1903-largest-odd-number-in-string/largest-odd-number.cpp:6
Method
largestOddNumber
Alternative implementation using enumerate and next() function.
1903-largest-odd-number-in-string/largest-odd-number-in-string.py:39
Method
largestPerimeter
(self, nums: List[int])
1018-largest-perimeter-triangle/largest-perimeter-triangle.py:2
Method
largestRectangleArea
84-largest-rectangle-in-histogram/largest-rectangle-in-histogram.cpp:3
Method
largestRectangleArea
(self, heights: list[int])
84-largest-rectangle-in-histogram/largest-rectangle-in-histogram.py:2
Method
largestSumAfterKNegations
(self, nums: List[int], k: int)
1047-maximize-sum-of-array-after-k-negations/maximize-sum-of-array-after-k-negations.py:2
Method
lcaDeepestLeaves
(self, root: Optional[TreeNode])
1218-lowest-common-ancestor-of-deepest-leaves/lowest-common-ancestor-of-deepest-leaves.py:8
Method
lcm
(a, b)
2307-replace-non-coprime-numbers-in-array/replace-non-coprime-numbers-in-array.py:4
Method
leastInterval
(self, tasks: List[str], n: int)
621-task-scheduler/task-scheduler.py:2
Method
leftRightDifference
(self, nums: List[int])
2714-left-and-right-sum-differences/left-and-right-sum-differences.py:2
Method
lengthAfterTransformations
(self, s: str, t: int)
3335-Total-Characters-in-String-After-Transformations/Total-Characters-in-String-After-Transformations.py:2
Function
lengthOfLIS
(nums)
300-longest-increasing-subsequence/longest-increasing-subsequence.js:7
Method
lengthOfLIS
(self, nums: List[int])
300-longest-increasing-subsequence/longest-increasing-subsequence.py:7
Method
lengthOfLIS
(int[] nums)
300-longest-increasing-subsequence/longest-increasing-subsequence.java:6
Method
lengthOfLastWord
(String s)
58-length-of-last-word/Solution.java:2
Method
lengthOfLongestSubsequence
(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
Function
lengthOfLongestSubstring
(s)
3-Longest-Substring-Without-Repeating-Characters/longest-substring-without-repeating-characters.js:5
Method
lengthOfLongestSubstring
(self, s: str)
3-Longest-Substring-Without-Repeating-Characters/longest-substring-without-repeating-characters.py:2
Method
lengthOfLongestSubstring
(String s)
3-Longest-Substring-Without-Repeating-Characters/longest-substring-without-repeating-characters.java:5
Method
letterCombinations
(String digits)
17-letter-combination-of-a-phone-number/Solution.java:8
Method
levelOrder
(self, root: Optional[TreeNode])
102-binary-tree-level-order-traversal/binary-tree-level-order-traversal.py:8
Method
longestArithSeqLength
(self, nums: List[int])
1087-longest-arithmetic-subsequence/longest-arithmetic-subsequence.py:2
Method
longestCommonPrefix
(self, strs)
14-longest-common-prefix/longest-common-prefix.py:2
Function
longestCommonSubsequence
(text1, text2)
1143-Longest-common-subsequence/longest-common-subsequence.js:8
Method
longestCommonSubsequence
(self, text1: str, text2: str)
1143-Longest-common-subsequence/longest-common-subsequence.py:4
Method
longestCommonSubsequence
(String text1, String text2)
1143-Longest-common-subsequence/longest-common-subsequence.java:4
Method
longestCommonSubsequence
1143-Longest-common-subsequence/longest-common-subsequence.cpp:3
Function
longestConsecutive
(nums)
128-longest-consecutive-sequence/longest-consecutive-sequence.js:7
Method
longestConsecutive
(int[] nums)
128-longest-consecutive-sequence/longest-consecutive-sequence.java:7
Method
longestConsecutive
(self, nums: List[int])
128-longest-consecutive-sequence/longest-consecutive-sequence.py:6
Method
longestOnes
(self, nums: List[int], k: int)
1046-max-consecutive-ones-iii/max-consecutive-ones-iii.py:2
Method
longestSquareStreak
(self, nums: List[int])
2586-longest-square-streak-in-an-array/longest-square-streak-in-an-array.py:2
Function
longestSubarray
(nums)
1493. Longest Subarray of 1's After Deleting One Element/longest-subarray-of-1s-after-deleting-one -element.py:1
Function
main
994-Rotting-Oranges/Rotting-Oranges.cpp:83
Function
main
Helper main for quick local testing
22-generate-parentheses/generate-parentheses.cpp:33
Function
main
417-PacificAtlanticWaterFlow/417-PacificAtlanticWaterFlow.cpp:62
Function
main
-4-Median-Of-Two-Sorted-Arrays/-4-median_of_two_sorted_arrays.cpp:37
Function
main
3704-count-no-zero-pairs-that-sum-to-n/3704-count-no-zero-pairs-that-sum-to-n.cpp:78
Function
main
322_Coin_Change/322_Coin_Change.cpp:20
Function
main
Example test
322_Coin_Change/217-contains-duplicate/contains-duplicate.cpp:24
Function
main
Helper main for quick local testing
-242-Valid-Anagram/Valid_Anagram.cpp:20
Function
main
Helper main for quick local testing
18-4sum/4sum.cpp:36
Function
main
194-transpose-file/194-transpose-file.cpp:8
Function
main
Example usage
3-Longest-Substring-Without-Repeating-Characters/Solution.cpp:24
Function
main
2528-Maximize-the-Minimum-Powered-City/2528-Maximize-the-Minimum-Powered-City.cpp:75
Function
main
3691-maximum-total-subarray-value-ii/3691-maximum-total-subarray-value-ii.cpp:271
Function
main
189-Rotate-Array/189_Rotate_Array.cpp:27
Function
main
local test
3347-maximum-frequency-of-an-element-after-performing-operations-ii/3347-maximum-frequency-of-an-element-after-performing-operations-ii.cpp:47
Function
main
-68-Text_Justification/Code.cpp:57
Function
main
Example main (local testing)
2286-booking-concert-tickets-in-groups/2286-booking-concert-tickets-in-groups.cpp:122
Function
main
2472-maximum-number-of-non-overlapping-palindrome-substrings/2472-maximum-number-of-non-overlapping-palindrome-substrings.cpp:66
Function
main
============================ Main Function (Example Test) ============================
MinimizeHammingDistance/MinimizeHammingDistance.cpp:76
Function
main
Helper to run basic local tests (not used on LeetCode submission)
-2127-Maximum-Employee-to-be-invited-to-a-meeting/Maximum_Employee.cpp:68
Function
main
Helper main for quick local testing
-118-Pascal's-triangle/pascals_triangle.cpp:21
Function
main
Helper main for quick local testing
6.Zigzag-Conversion/zigzag-conversion.cpp:24
Function
main
1493. Longest Subarray of 1's After Deleting One Element/longest-subarray-of-1s-after-deleting-one-element.cpp:36
Method
main
(String[] args)
417-PacificAtlanticWaterFlow/417-PacificAtlanticWaterFlow.java:60
Method
main
(String[] args)
3-Longest-Substring-Without-Repeating-Characters/Solution.java:20
Method
main
(String[] args)
-68-Text_Justification/Code.java:54
Method
majorityElement
229-majority-element-ii/majority-element-ii.cpp:3
Method
makeFancyString
(self, s: str)
1302-delete-characters-to-make-fancy-string/delete-characters-to-make-fancy-string.py:2
Method
mapWordWeights
(self, words: List[str], weights: List[int])
4216-weighted-word-mapping/weighted-word-mapping.py:2
Method
matchPlayersAndTrainers
(self, players: List[int], trainers: List[int])
2497-maximum-matching-of-players-with-trainers/maximum-matching-of-players-with-trainers.py:2
Method
matrixReshape
(self, mat: List[List[int]], r: int, c: int)
566-reshape-the-matrix/reshape-the-matrix.py:2
Function
maxArea
(height)
11-container-with-most-water/container-with-most-water.js:7
Method
maxArea
(int[] height)
11-container-with-most-water-leetcode/solution.java:2
Method
maxArea
11-container-with-most-water-leetcode/solution.cpp:6
Method
maxArea
(self, height: List[int])
11-container-with-most-water/container-with-most-water.py:6
Method
maxArea
(int[] height)
11-container-with-most-water/container-with-most-water.java:4
Method
maxBottlesDrunk
(self, numBottles: int, numexchange: int)
3336-water-bottles-ii/water-bottles-ii.py:2
Method
maxDepth
(self, root: 'Node')
774-maximum-depth-of-n-ary-tree/maximum-depth-of-n-ary-tree.py:11
Method
maxDepth
(self, root: Optional[TreeNode])
104-maximum-depth-of-binary-tree/maximum-depth-of-binary-tree.py:9
Method
maxDistance
(self, moves: str)
4340-maximum-manhattan-distance-after-all-moves/maximum-manhattan-distance-after-all-moves.py:2
Method
maxDistinct
(self, s: str)
4087-maximum-substrings-with-distinct-start/maximum-substrings-with-distinct-start.py:2
Method
maxFreqSum
(self, s: str)
3872-find-most-frequent-vowel-and-consonant/find-most-frequent-vowel-and-consonant.py:2
← previous
next →
401–500 of 798, ranked by callers