8000 leetcode/algorithms/cpp/wordSearch/wordSearch.cpp at master · pjq/leetcode · GitHub
[go: up one dir, main page]

Skip to content
< 8000 script type="application/json" data-target="react-app.embeddedData">{"payload":{"allShortcutsEnabled":false,"fileTree":{"algorithms/cpp/wordSearch":{"items":[{"name":"wordSearch.II.cpp","path":"algorithms/cpp/wordSearch/wordSearch.II.cpp","contentType":"file"},{"name":"wordSearch.cpp","path":"algorithms/cpp/wordSearch/wordSearch.cpp","contentType":"file"}],"totalCount":2},"algorithms/cpp":{"items":[{"name":"3Sum","path":"algorithms/cpp/3Sum","contentType":"directory"},{"name":"3SumClosest","path":"algorithms/cpp/3SumClosest","contentType":"directory"},{"name":"4Sum","path":"algorithms/cpp/4Sum","contentType":"directory"},{"name":"LRUCache","path":"algorithms/cpp/LRUCache","contentType":"directory"},{"name":"UTF8Validation","path":"algorithms/cpp/UTF8Validation","contentType":"directory"},{"name":"accountsMerge","path":"algorithms/cpp/accountsMerge","contentType":"directory"},{"name":"addAndSearchWord","path":"algorithms/cpp/addAndSearchWord","contentType":"directory"},{"name":"addBinary","path":"algorithms/cpp/addBinary","contentType":"directory"},{"name":"addDigits","path":"algorithms/cpp/addDigits","contentType":"directory"},{"name":"addStrings","path":"algorithms/cpp/addStrings","contentType":"directory"},{"name":"addToArrayFormOfInteger","path":"algorithms/cpp/addToArrayFormOfInteger","contentType":"directory"},{"name":"addTwoNumbers","path":"algorithms/cpp/addTwoNumbers","contentType":"directory"},{"name":"additiveNumber","path":"algorithms/cpp/additiveNumber","contentType":"directory"},{"name":"anagrams","path":"algorithms/cpp/anagrams","contentType":"directory"},{"name":"arithmeticSlices","path":"algorithms/cpp/arithmeticSlices","contentType":"directory"},{"name":"backspaceStringCompare","path":"algorithms/cpp/backspaceStringCompare","contentType":"directory"},{"name":"balancedBinaryTree","path":"algorithms/cpp/balancedBinaryTree","contentType":"directory"},{"name":"basicCalculator","path":"algorithms/cpp/basicCalculator","contentType":"directory"},{"name":"bestTimeToBuyAndSellStock","path":"algorithms/cpp/bestTimeToBuyAndSellStock","contentType":"directory"},{"name":"binarySearchTreeIterator","path":"algorithms/cpp/binarySearchTreeIterator","contentType":"directory"},{"name":"binaryTreeInorderTraversal","path":"algorithms/cpp/binaryTreeInorderTraversal","contentType":"directory"},{"name":"binaryTreeLevelOrderTraversal","path":"algorithms/cpp/binaryTreeLevelOrderTraversal","contentType":"directory"},{"name":"binaryTreeMaximumPathSum","path":"algorithms/cpp/binaryTreeMaximumPathSum","contentType":"directory"},{"name":"binaryTreePaths","path":"algorithms/cpp/binaryTreePaths","contentType":"directory"},{"name":"binaryTreePostorderTraversal","path":"algorithms/cpp/binaryTreePostorderTraversal","contentType":"directory"},{"name":"binaryTreePreorderTraversal","path":"algorithms/cpp/binaryTreePreorderTraversal","contentType":"directory"},{"name":"binaryTreeRightSideView","path":"algorithms/cpp/binaryTreeRightSideView","contentType":"directory"},{"name":"binaryTreeUpsideDown","path":"algorithms/cpp/binaryTreeUpsideDown","contentType":"directory"},{"name":"binaryTreeZigzagLevelOrderTraversal","path":"algorithms/cpp/binaryTreeZigzagLevelOrderTraversal","contentType":"directory"},{"name":"binaryWatch","path":"algorithms/cpp/binaryWatch","contentType":"directory"},{"name":"bitwiseANDOfNumbersRange","path":"algorithms/cpp/bitwiseANDOfNumbersRange","contentType":"directory"},{"name":"brokenCalculator","path":"algorithms/cpp/brokenCalculator","contentType":"directory"},{"name":"buddyStrings","path":"algorithms/cpp/buddyStrings","contentType":"directory"},{"name":"bulbSwitcher","path":"algorithms/cpp/bulbSwitcher","contentType":"directory"},{"name":"bullsAndCows","path":"algorithms/cpp/bullsAndCows","contentType":"directory"},{"name":"burstBalloons","path":"algorithms/cpp/burstBalloons","contentType":"directory"},{"name":"candy","path":"algorithms/cpp/candy","contentType":"directory"},{"name":"climbStairs","path":"algorithms/cpp/climbStairs","contentType":"directory"},{"name":"cloneGraph","path":"algorithms/cpp/cloneGraph","contentType":"directory"},{"name":"coinChange","path":"algorithms/cpp/coinChange","contentType":"directory"},{"name":"combinationSum","path":"algorithms/cpp/combinationSum","contentType":"directory"},{"name":"combinationSumIV","path":"algorithms/cpp/combinationSumIV","contentType":"directory"},{"name":"combinations","path":"algorithms/cpp/combinations","contentType":"directory"},{"name":"compareStringsByFrequencyOfTheSmallestCharacter","path":"algorithms/cpp/compareStringsByFrequencyOfTheSmallestCharacter","contentType":"directory"},{"name":"compareVersionNumbers","path":"algorithms/cpp/compareVersionNumbers","contentType":"directory"},{"name":"constructBinaryTreeFromInorderAndPostorderTraversal","path":"algorithms/cpp/constructBinaryTreeFromInorderAndPostorderTraversal","contentType":"directory"},{"name":"constructBinaryTreeFromPreorderAndInorderTraversal","path":"algorithms/cpp/constructBinaryTreeFromPreorderAndInorderTraversal","contentType":"directory"},{"name":"containerWithMostWater","path":"algorithms/cpp/containerWithMostWater","contentType":"directory"},{"name":"containsDuplicate","path":"algorithms/cpp/containsDuplicate","contentType":"directory"},{"name":"convertANumberToHexadecimal","path":"algorithms/cpp/convertANumberToHexadecimal","contentType":"directory"},{"name":"convertSortedArrayToBinarySearchTree","path":"algorithms/cpp/convertSortedArrayToBinarySearchTree","contentType":"directory"},{"name":"convertSortedListToBinarySearchTree","path":"algorithms/cpp/convertSortedListToBinarySearchTree","contentType":"directory"},{"name":"copyListWithRandomPointer","path":"algorithms/cpp/copyListWithRandomPointer","contentType":"directory"},{"name":"countAndSay","path":"algorithms/cpp/countAndSay","contentType":"directory"},{"name":"countCompleteTreeNodes","path":"algorithms/cpp/countCompleteTreeNodes","contentType":"directory"},{"name":"countNumbersWithUniqueDigits","path":"algorithms/cpp/countNumbersWithUniqueDigits","contentType":"directory"},{"name":"countOfRangeSum","path":"algorithms/cpp/countOfRangeSum","contentType":"directory"},{"name":"countOfSmallerNumbersAfterSelf","path":"algorithms/cpp/countOfSmallerNumbersAfterSelf","contentType":"directory"},{"name":"countPrimes","path":"algorithms/cpp/countPrimes","contentType":"directory"},{"name":"countingBits","path":"algorithms/cpp/countingBits","contentType":"directory"},{"name":"courseSchedule","path":"algorithms/cpp/courseSchedule","contentType":"directory"},{"name":"cousinsInBinaryTree","path":"algorithms/cpp/cousinsInBinaryTree","contentType":"directory"},{"name":"createMaximumNumber","path":"algorithms/cpp/createMaximumNumber","contentType":"directory"},{"name":"decodeString","path":"algorithms/cpp/decodeString","contentType":"directory"},{"name":"decodeWays","path":"algorithms/cpp/decodeWays","contentType":"directory"},{"name":"deleteNodeInALinkedList","path":"algorithms/cpp/deleteNodeInALinkedList","contentType":"directory"},{"name":"detectCapital","path":"algorithms/cpp/detectCapital","contentType":"directory"},{"name":"differentWaysToAddParentheses","path":"algorithms/cpp/differentWaysToAddParentheses","contentType":"directory"},{"name":"distinctSubsequences","path":"algorithms/cpp/distinctSubsequences","contentType":"directory"},{"name":"distributeCoinsInBinaryTree","path":"algorithms/cpp/distributeCoinsInBinaryTree","contentType":"directory"},{"name":"divideTwoInt","path":"algorithms/cpp/divideTwoInt","contentType":"directory"},{"name":"dungeonGame","path":"algorithms/cpp/dungeonGame","contentType":"directory"},{"name":"editDistance","path":"algorithms/cpp/editDistance","contentType":"directory"},{"name":"eliminationGame","path":"algorithms/cpp/eliminationGame","contentType":"directory"},{"name":"evaluateDivision","path":"algorithms/cpp/evaluateDivision","contentType":"directory"},{"name":"evaluateReversePolishNotation","path":"algorithms/cpp/evaluateReversePolishNotation","contentType":"directory"},{"name":"excelSheetColumnNumber","path":"algorithms/cpp/excelSheetColumnNumber","contentType":"directory"},{"name":"excelSheetColumnTitle","path":"algorithms/cpp/excelSheetColumnTitle","contentType":"directory"},{"name":"expressionAddOperators","path":"algorithms/cpp/expressionAddOperators","contentType":"directory"},{"name":"factorialTrailingZeroes","path":"algorithms/cpp/factorialTrailingZeroes","contentType":"directory"},{"name":"fibonacciNumber","path":"algorithms/cpp/fibonacciNumber","contentType":"directory"},{"name":"findAllAnagramsInAString","path":"algorithms/cpp/findAllAnagramsInAString","contentType":"directory"},{"name":"findMedianFromDataStream","path":"algorithms/cpp/findMedianFromDataStream","contentType":"directory"},{"name":"findMinimumInRotatedSortedArray","path":"algorithms/cpp/findMinimumInRotatedSortedArray","contentType":"directory"},{"name":"findPeakElement","path":"algorithms/cpp/findPeakElement","contentType":"directory"},{"name":"findTheDifference","path":"algorithms/cpp/findTheDifference","contentType":"directory"},{"name":"findTheDuplicateNumber","path":"algorithms/cpp/findTheDuplicateNumber","contentType":"directory"},{"name":"firstBadVersion","path":"algorithms/cpp/firstBadVersion","contentType":"directory"},{"name":"firstMissingPositive","path":"algorithms/cpp/firstMissingPositive","contentType":"directory"},{"name":"firstUniqueCharacterInAString","path":"algorithms/cpp/firstUniqueCharacterInAString","contentType":"directory"},{"name":"fizzBuzz","path":"algorithms/cpp/fizzBuzz","contentType":"directory"},{"name":"flattenBinaryTreeToLinkedList","path":"algorithms/cpp/flattenBinaryTreeToLinkedList","contentType":"directory"},{"name":"flattenNestedListIterator","path":"algorithms/cpp/flattenNestedListIterator","contentType":"directory"},{"name":"fractionToRecurringDecimal","path":"algorithms/cpp/fractionToRecurringDecimal","contentType":"directory"},{"name":"friendCircles","path":"algorithms/cpp/friendCircles","contentType":"directory"},{"name":"frogJump","path":"algorithms/cpp/frogJump","contentType":"directory"},{"name":"gameOfLife","path":"algorithms/cpp/gameOfLife","contentType":"directory"},{"name":"gasStation","path":"algorithms/cpp/gasStation","contentType":"directory"},{"name":"generateParentheses","path":"algorithms/cpp/generateParentheses","contentType":"directory"},{"name":"grayCode","path":"algorithms/cpp/grayCode","contentType":"directory"},{"name":"greatestCommonDivisorOfStrings","path":"algorithms/cpp/greatestCommonDivisorOfStrings","contentType":"directory"},{"name":"h-Index","path":"algorithms/cpp/h-Index","contentType":"directory"},{"name":"happyNumber","path":"algorithms/cpp/happyNumber","contentType":"directory"},{"name":"houseRobber","path":"algorithms/cpp/houseRobber","contentType":"directory"},{"name":"implementQueueUsingStacks","path":"algorithms/cpp/implementQueueUsingStacks","contentType":"directory"},{"name":"implementStackUsingQueues","path":"algorithms/cpp/implementStackUsingQueues","contentType":"directory"},{"name":"implementTriePrefixTree","path":"algorithms/cpp/implementTriePrefixTree","contentType":"directory"},{"name":"increasingTripletSubsequence","path":"algorithms/cpp/increasingTripletSubsequence","contentType":"directory"},{"name":"insertDeleteGetRandom","path":"algorithms/cpp/insertDeleteGetRandom","contentType":"directory"},{"name":"insertInterval","path":"algorithms/cpp/insertInterval","contentType":"directory"},{"name":"insertionSortList","path":"algorithms/cpp/insertionSortList","contentType":"directory"},{"name":"integerBreak","path":"algorithms/cpp/integerBreak","contentType":"directory"},{"name":"integerReplacement","path":"algorithms/cpp/integerReplacement","contentType":"directory"},{"name":"integerToEnglishWords","path":"algorithms/cpp/integerToEnglishWords","contentType":"directory"},{"name":"integerToRoman","path":"algorithms/cpp/integerToRoman","contentType":"directory"},{"name":"interleavingString","path":"algorithms/cpp/interleavingString","contentType":"directory"},{"name":"intersectionOfTwoArrays","path":"algorithms/cpp/intersectionOfTwoArrays","contentType":"directory"},{"name":"intersectionOfTwoLinkedLists","path":"algorithms/cpp/intersectionOfTwoLinkedLists","contentType":"directory"},{"name":"intervalListIntersectons","path":"algorithms/cpp/intervalListIntersectons","contentType":"directory"},{"name":"invertBinaryTree","path":"algorithms/cpp/invertBinaryTree","contentType":"directory"},{"name":"isSubsequence","path":"algorithms/cpp/isSubsequence","contentType":"directory"},{"name":"islandPerimeter","path":"algorithms/cpp/islandPerimeter","contentType":"directory"},{"name":"isomorphicStrings","path":"algorithms/cpp/isomorphicStrings","contentType":"directory"},{"name":"jewelsAndStones","path":"algorithms/cpp/jewelsAndStones","contentType":"directory"},{"name":"jumpGame","path":"algorithms/cpp/jumpGame","contentType":"directory"},{"name":"kthLargestElementInAnArray","path":"algorithms/cpp/kthLargestElementInAnArray","contentType":"directory"},{"name":"kthSmallestElementInaBST","path":"algorithms/cpp/kthSmallestElementInaBST","contentType":"directory"},{"name":"largestNumber","path":"algorithms/cpp/largestNumber","contentType":"directory"},{"name":"largestPerimeterTriangle","path":"algorithms/cpp/largestPerimeterTriangle","contentType":"directory"},{"name":"largestRectangleInHistogram","path":"algorithms/cpp/largestRectangleInHistogram","contentType":"directory"},{"name":"lengthOfLastWord","path":"algorithms/cpp/lengthOfLastWord","contentType":"directory"},{"name":"letterCombinationsOfAPhoneNumber","path":"algorithms/cpp/letterCombinationsOfAPhoneNumber","contentType":"directory"},{"name":"lexicographicalNumbers","path":"algorithms/cpp/lexicographicalNumbers","contentType":"directory"},{"name":"linkedListCycle","path":"algorithms/cpp/linkedListCycle","contentType":"directory"},{"name":"linkedListRandomNode","path":"algorithms/cpp/linkedListRandomNode","contentType":"directory"},{"name":"longestAbsoluteFilePath","path":"algorithms/cpp/longestAbsoluteFilePath","contentType":"directory"},{"name":"longestCommonPrefix","path":"algorithms/cpp/longestCommonPrefix","contentType":"directory"},{"name":"longestConsecutiveSequence","path":"algorithms/cpp/longestConsecutiveSequence","contentType":"directory"},{"name":"longestIncreasingPathInAMatrix","path":"algorithms/cpp/longestIncreasingPathInAMatrix","contentType":"directory"},{"name":"longestIncreasingSubsequence","path":"algorithms/cpp/longestIncreasingSubsequence","contentType":"directory"},{"name":"longestPalindrome","path":"algorithms/cpp/longestPalindrome","contentType":"directory"},{"name":"longestPalindromicSubstring","path":"algorithms/cpp/longestPalindromicSubstring","contentType":"directory"},{"name":"longestSubstringWithAtLeastKRepeatingCharacters","path":"algorithms/cpp/longestSubstringWithAtLeastKRepeatingCharacters","contentType":"directory"},{"name":"longestSubstringWithAtMostTwoDistinctCharacters","path":"algorithms/cpp/longestSubstringWithAtMostTwoDistinctCharacters","contentType":"directory"},{"name":"longestSubstringWithoutRepeatingCharacters","path":"algorithms/cpp/longestSubstringWithoutRepeatingCharacters","contentType":"directory"},{"name":"longestTurbulentSubarray","path":"algorithms/cpp/longestTurbulentSubarray","contentType":"directory"},{"name":"longestValidParentheses","path":"algorithms/cpp/longestValidParentheses","contentType":"directory"},{"name":"lowestCommonAncestorOfABinarySearchTree","path":"algorithms/cpp/lowestCommonAncestorOfABinarySearchTree","contentType":"directory"},{"name":"lowestCommonAncestorOfABinaryTree","path":"algorithms/cpp/lowestCommonAncestorOfABinaryTree","contentType":"directory"},{"name":"majorityElement","path":"algorithms/cpp/majorityElement","contentType":"directory"},{"name":"maxAreaOfIsland","path":"algorithms/cpp/maxAreaOfIsland","contentType":"directory"},{"name":"maxPointsOnALine","path":"algorithms/cpp/maxPointsOnALine","contentType":"directory"},{"name":"maximalRectangle","path":"algorithms/cpp/maximalRectangle","contentType":"directory"},{"name":"maximalSquare","path":"algorithms/cpp/maximalSquare","contentType":"directory"},{"name":"maximumAverageSubarray","path":"algorithms/cpp/maximumAverageSubarray","contentType":"directory"},{"name":"maximumDepthOfBinaryTree","path":"algorithms/cpp/maximumDepthOfBinaryTree","contentType":"directory"},{"name":"maximumGap","path":"algorithms/cpp/maximumGap","contentType":"directory"},{"name":"maximumProductOfWordLengths","path":"algorithms/cpp/maximumProductOfWordLengths","contentType":"directory"},{"name":"maximumProductSubarray","path":"algorithms/cpp/maximumProductSubarray","contentType":"directory"},{"name":"maximumSubArray","path":"algorithms/cpp/maximumSubArray","contentType":"directory"},{"name":"medianOfTwoSortedArrays","path":"algorithms/cpp/medianOfTwoSortedArrays","contentType":"directory"},{"name":"mergeIntervals","path":"algorithms/cpp/mergeIntervals","contentType":"directory"},{"name":"mergeKSortedLists","path":"algorithms/cpp/mergeKSortedLists","contentType":"directory"},{"name":"mergeTwoSortedArray","path":"algorithms/cpp/mergeTwoSortedArray","contentType":"directory"},{"name":"mergeTwoSortedList","path":"algorithms/cpp/mergeTwoSortedList","contentType":"directory"},{"name":"minCostClimbingStairs","path":"algorithms/cpp/minCostClimbingStairs","contentType":"directory"},{"name":"minStack","path":"algorithms/cpp/minStack","contentType":"directory"},{"name":"miniParser","path":"algorithms/cpp/miniParser","contentType":"directory"},{"name":"minimumASCIIDeleteSumForTwoStrings","path":"algorithms/cpp/minimumASCIIDeleteSumForTwoStrings","contentType":"directory"},{"name":"minimumCostForTickets","path":"algorithms/cpp/minimumCostForTickets","contentType":"directory"},{"name":"minimumDepthOfBinaryTree","path":"algorithms/cpp/minimumDepthOfBinaryTree","contentType":"directory"},{"name":"minimumFallingPathSum","path":"algorithms/cpp/minimumFallingPathSum","contentType":"directory"},{"name":"minimumHeightTrees","path":"algorithms/cpp/minimumHeightTrees","contentType":"directory"},{"name":"minimumPathSum","path":"algorithms/cpp/minimumPathSum","contentType":"directory"},{"name":"minimumSizeSubarraySum","path":"algorithms/cpp/minimumSizeSubarraySum","contentType":"directory"},{"name":"minimumWindowSubstring","path":"algorithms/cpp/minimumWindowSubstring","contentType":"directory"},{"name":"mirrorReflection","path":"algorithms/cpp/mirrorReflection","contentType":"directory"},{"name":"missingNumber","path":"algorithms/cpp/missingNumber","contentType":"directory"},{"name":"missingRanges","path":"algorithms/cpp/missingRanges","contentType":"directory"},{"name":"mostCommonWord","path":"algorithms/cpp/mostCommonWord","contentType":"directory"},{"name":"moveZeroes","path":"algorithms/cpp/moveZeroes","contentType":"directory"},{"name":"multiplyStrings","path":"algorithms/cpp/multiplyStrings","contentType":"directory"},{"name":"nQueens","path":"algorithms/cpp/nQueens","contentType":"directory"},{"name":"nRepeatedElementInSize2NArray","path":"algorithms/cpp/nRepeatedElementInSize2NArray","contentType":"directory"},{"name":"nextPermutation","path":"algorithms/cpp/nextPermutation","contentType":"directory"},{"name":"nimGame","path":"algorithms/cpp/nimGame","contentType":"directory"},{"name":"nthDigit","path":"algorithms/cpp/nthDigit","contentType":"directory"},{"name":"numberOf1Bits","path":"algorithms/cpp/numberOf1Bits","contentType":"directory"},{"name":"numberOfDigitOne","path":"algorithms/cpp/numberOfDigitOne","contentType":"directory"},{"name":"numberOfIslands","path":"algorithms/cpp/numberOfIslands","contentType":"directory"},{"name":"numberOfRecentCalls","path":"algorithms/cpp/numberOfRecentCalls","contentType":"directory"},{"name":"oddEvenLinkedList","path":"algorithms/cpp/oddEvenLinkedList","contentType":"directory"},{"name":"oneEditDistance","path":"algorithms/cpp/oneEditDistance","contentType":"directory"},{"name":"palindromeLinkedList","path":"algorithms/cpp/palindromeLinkedList","contentType":"directory"},{"name":"palindromeNumber","path":"algorithms/cpp/palindromeNumber","contentType":"directory"},{"name":"palindromePairs","path":"algorithms/cpp/palindromePairs","contentType":"directory"},{"name":"palindromePartitioning","path":"algorithms/cpp/palindromePartitioning","contentType":"directory"},{"name":"palindromicSubstrings","path":"algorithms/cpp/palindromicSubstrings","contentType":"directory"},{"name":"partitionEqualSubsetSum","path":"algorithms/cpp/partitionEqualSubsetSum","contentType":"directory"},{"name":"partitionList","path":"algorithms/cpp/partitionList","contentType":"directory"},{"name":"pascalTriangle","path":"algorithms/cpp/pascalTriangle","contentType":"directory"},{"name":"patchingArray","path":"algorithms/cpp/patchingArray","contentType":"directory"},{"name":"pathSum","path":"algorithms/cpp/pathSum","contentType":"directory"},{"name":"peakIndexInAMountainArray","path":"algorithms/cpp/peakIndexInAMountainArray","contentType":"directory"},{"name":"peekingIterator","path":"algorithms/cpp/peekingIterator","contentType":"directory"},{"name":"perfectRectangle","path":"algorithms/cpp/perfectRectangle","contentType":"directory"},{"name":"perfectSquares","path":"algorithms/cpp/perfectSquares","contentType":"directory"},{"name":"permutationSequence","path":"algorithms/cpp/permutationSequence","contentType":"directory"},{"name":"permutations","path":"algorithms/cpp/permutations","contentType":"directory"},{"name":"plusOne","path":"algorithms/cpp/plusOne","contentType":"directory"},{"name":"populatingNextRightPointersInEachNode","path":"algorithms/cpp/populatingNextRightPointersInEachNode","contentType":"directory"},{"name":"pow","path":"algorithms/cpp/pow","contentType":"directory"},{"name":"powerOfFour","path":"algorithms/cpp/powerOfFour","contentType":"directory"},{"name":"powerOfThree","path":"algorithms/cpp/powerOfThree","contentType":"directory"},{"name":"powerOfTwo","path":"algorithms/cpp/powerOfTwo","contentType":"directory"},{"name":"productOfArrayExceptSelf","path":"algorithms/cpp/productOfArrayExceptSelf","contentType":"directory"},{"name":"queueReconstructionByHeight","path":"algorithms/cpp/queueReconstructionByHeight","contentType":"directory"},{"name":"randomPickIndex","path":"algorithms/cpp/randomPickIndex","contentType":"directory"},{"name":"rangeSumQuery-Immutable","path":"algorithms/cpp/rangeSumQuery-Immutable","contentType":"directory"},{"name":"rangeSumQuery2D-Immutable","path":"algorithms/cpp/rangeSumQuery2D-Immutable","contentType":"directory"},{"name":"ransomNote","path":"algorithms/cpp/ransomNote","contentType":"directory"},{"name":"readNCharactersGivenRead4","path":"algorithms/cpp/readNCharactersGivenRead4","contentType":"directory"},{"name":"reconstructItinerary","path":"algorithms/cpp/reconstructItinerary","contentType":"directory"},{"name":"recoverATreeFromPreorderTraversal","path":"algorithms/cpp/recoverATreeFromPreorderTraversal","contentType":"directory"},{"name":"recoverBinarySearchTree","path":"algorithms/cpp/recoverBinarySearchTree","contentType":"directory"},{"name":"rectangleArea","path":"algorithms/cpp/rectangleArea","contentType":"directory"},{"name":"regularExpressionMatching","path":"algorithms/cpp/regularExpressionMatching","contentType":"directory"},{"name":"removeDuplicateLetters","path":"algorithms/cpp/removeDuplicateLetters","contentType":"directory"},{"name":"removeDuplicatesFromSortedArray","path":"algorithms/cpp/removeDuplicatesFromSortedArray","contentType":"directory"},{"name":"removeDuplicatesFromSortedList","path":"algorithms/cpp/removeDuplicatesFromSortedList","contentType":"directory"},{"name":"removeElement","path":"algorithms/cpp/removeElement","contentType":"directory"},{"name":"removeInvalidParentheses","path":"algorithms/cpp/removeInvalidParentheses","contentType":"directory"},{"name":"removeKDigits","path":"algorithms/cpp/removeKDigits","contentType":"directory"},{"name":"removeLinkedListElements","path":"algorithms/cpp/removeLinkedListElements","contentType":"directory"},{"name":"removeNthNodeFromEndOfList","path":"algorithms/cpp/removeNthNodeFromEndOfList","contentType":"directory"},{"name":"reorderList","path":"algorithms/cpp/reorderList","contentType":"directory"},{"name":"repeatedDNASequences","path":"algorithms/cpp/repeatedDNASequences","contentType":"directory"},{"name":"restoreIPAddresses","path":"algorithms/cpp/restoreIPAddresses","contentType":"directory"},{"name":"reverseBits","path":"algorithms/cpp/reverseBits","contentType":"directory"},{"name":"reverseInteger","path":"algorithms/cpp/reverseInteger","contentType":"directory"},{"name":"reverseLinkedList","path":"algorithms/cpp/reverseLinkedList","contentType":"directory"},{"name":"reverseNodesInKGroup","path":"algorithms/cpp/reverseNodesInKGroup","contentType":"directory"},{"name":"reverseString","path":"algorithms/cpp/reverseString","contentType":"directory"},{"name":"reverseVowelsOfAString","path":"algorithms/cpp/reverseVowelsOfAString","contentType":"directory"},{"name":"reverseWordsInAString","path":"algorithms/cpp/reverseWordsInAString","contentType":"directory"},{"name":"romanToInteger","path":"algorithms/cpp/romanToInteger","contentType":"directory"},{"name":"rotateArray","path":"algorithms/cpp/rotateArray","contentType":"directory"},{"name":"rotateFunction","path":"algorithms/cpp/rotateFunction","contentType":"directory"},{"name":"rotateImage","path":"algorithms/cpp/rotateImage","contentType":"directory"},{"name":"rotateList","path":"algorithms/cpp/rotateList","contentType":"directory"},{"name":"sameTree","path":"algorithms/cpp/sameTree","contentType":"directory"},{"name":"satisfiabilityOfEqualityEquations","path":"algorithms/cpp/satisfiabilityOfEqualityEquations","contentType":"directory"},{"name":"scrambleString","path":"algorithms/cpp/scrambleString","contentType":"directory"},{"name":"search2DMatrix","path":"algorithms/cpp/search2DMatrix","contentType":"directory"},{"name":"searchForRange","path":"algorithms/cpp/searchForRange","contentType":"directory"},{"name":"searchInRotatedSortedArray","path":"algorithms/cpp/searchInRotatedSortedArray","contentType":"directory"},{"name":"searchInsertPosition","path":"algorithms/cpp/searchInsertPosition","contentType":"directory"},{"name":"sentenceScreenFitting","path":"algorithms/cpp/sentenceScreenFitting","contentType":"directory"},{"name":"serializeAndDeserializeBinaryTree","path":"algorithms/cpp/serializeAndDeserializeBinaryTree","contentType":"directory"},{"name":"setMatrixZeroes","path":"algorithms/cpp/setMatrixZeroes","contentType":"directory"},{"name":"shortestPalindrome","path":"algorithms/cpp/shortestPalindrome","contentType":"directory"},{"name":"shuffleAnArray","path":"algorithms/cpp/shuffleAnArray","contentType":"directory"},{"name":"simplifyPath","path":"algorithms/cpp/simplifyPath","contentType":"directory"},{"name":"singleNumber","path":"algorithms/cpp/singleNumber","contentType":"directory"},{"name":"slidingWindowMaximum","path":"algorithms/cpp/slidingWindowMaximum","contentType":"directory"},{"name":"smallestStringStartingFromLeaf","path":"algorithms/cpp/smallestStringStartingFromLeaf","contentType":"directory"},{"name":"sortArrayByParity","path":"algorithms/cpp/sortArrayByParity","contentType":"directory"},{"name":"sortColors","path":"algorithms/cpp/sortColors","contentType":"directory"},{"name":"sortList","path":"algorithms/cpp/sortList","contentType":"directory"},{"name":"spiralMatrix","path":"algorithms/cpp/spiralMatrix","contentType":"directory"},{"name":"splitArrayLargestSum","path":"algorithms/cpp/splitArrayLargestSum","contentType":"directory"},{"name":"sqrt","path":"algorithms/cpp/sqrt","contentType":"directory"},{"name":"squaresOfASortedArray","path":"algorithms/cpp/squaresOfASortedArray","contentType":"directory"},{"name":"strStr","path":"algorithms/cpp/strStr","contentType":"directory"},{"name":"stringToIntegerAtoi","path":"algorithms/cpp/stringToIntegerAtoi","contentType":"directory"},{"name":"stringWithoutAAAOrBBB","path":"algorithms/cpp/stringWithoutAAAOrBBB","contentType":"directory"},{"name":"subsets","path":"algorithms/cpp/subsets","contentType":"directory"},{"name":"substringWithConcatenationOfAllWords","path":"algorithms/cpp/substringWithConcatenationOfAllWords","contentType":"directory"},{"name":"sudokuSolver","path":"algorithms/cpp/sudokuSolver","contentType":"directory"},{"name":"sumOfEvenNumbersAfterQueries","path":"algorithms/cpp/sumOfEvenNumbersAfterQueries","contentType":"directory"},{"name":"sumOfLeftLeaves","path":"algorithms/cpp/sumOfLeftLeaves","contentType":"directory"},{"name":"sumOfTwoIntegers","path":"algorithms/cpp/sumOfTwoIntegers","contentType":"directory"},{"name":"sumRootToLeafNumber","path":"algorithms/cpp/sumRootToLeafNumber","contentType":"directory"},{"name":"summaryRanges","path":"algorithms/cpp/summaryRanges","contentType":"directory"},{"name":"superUglyNumber","path":"algorithms/cpp/superUglyNumber","contentType":"directory"},{"name":"surroundedRegions","path":"algorithms/cpp/surroundedRegions","contentType":"directory"},{"name":"swapNodesInPairs","path":"algorithms/cpp/swapNodesInPairs","contentType":"directory"},{"name":"symmetricTree","path":"algorithms/cpp/symmetricTree","contentType":"directory"},{"name":"textJustification","path":"algorithms/cpp/textJustification","contentType":"directory"},{"name":"theSkylineProblem","path":"algorithms/cpp/theSkylineProblem","contentType":"directory"},{"name":"thirdMaximumNumber","path":"algorithms/cpp/thirdMaximumNumber","contentType":"directory"},{"name":"timeBasedKeyValueStore","path":"algorithms/cpp/timeBasedKeyValueStore","contentType":"directory"},{"name":"topKFrequentElements","path":"algorithms/cpp/topKFrequentElements","contentType":"directory"},{"name":"totalHammingDistance","path":"algorithms/cpp/totalHammingDistance","contentType":"directory"},{"name":"trappingRainWater","path":"algorithms/cpp/trappingRainWater","contentType":"directory"},{"name":"triangle","path":"algorithms/cpp/triangle","contentType":"directory"},{"name":"triplesWithBitwiseANDEqualToZero","path":"algorithms/cpp/triplesWithBitwiseANDEqualToZero","contentType":"directory"},{"name":"twoCityScheduling","path":"algorithms/cpp/twoCityScheduling","contentType":"directory"},{"name":"twoSum","path":"algorithms/cpp/twoSum","contentType":"directory"},{"name":"uglyNumber","path":"algorithms/cpp/uglyNumber","contentType":"directory"},{"name":"uniqueBinarySearchTrees","path":"algorithms/cpp/uniqueBinarySearchTrees","contentType":"directory"},{"name":"uniqueMorseCodeWords","path":"algorithms/cpp/uniqueMorseCodeWords","contentType":"directory"},{"name":"uniqueNumberOfOccurrences","path":"algorithms/cpp/uniqueNumberOfOccurrences","contentType":"directory"},{"name":"uniquePaths","path":"algorithms/cpp/uniquePaths","contentType":"directory"},{"name":"validNumber","path":"algorithms/cpp/validNumber","contentType":"directory"},{"name":"validPalindrome","path":"algorithms/cpp/validPalindrome","contentType":"directory"},{"name":"validParentheses","path":"algorithms/cpp/validParentheses","contentType":"directory"},{"name":"validSudoku","path":"algorithms/cpp/validSudoku","contentType":"directory"},{"name":"validateBinarySearchTree","path":"algorithms/cpp/validateBinarySearchTree","contentType":"directory"},{"name":"verifyPreorderSerializationOfABinaryTree","path":"algorithms/cpp/verifyPreorderSerializationOfABinaryTree","contentType":"directory"},{"name":"verticalOrderTraversalOfABinaryTree","path":"algorithms/cpp/verticalOrderTraversalOfABinaryTree","contentType":"directory"},{"name":"videoStitching","path":"algorithms/cpp/videoStitching","contentType":"directory"},{"name":"wiggleSort","path":"algorithms/cpp/wiggleSort","contentType":"directory"},{"name":"wiggleSubsequence","path":"algorithms/cpp/wiggleSubsequence","contentType":"directory"},{"name":"wildcardMatching","path":"algorithms/cpp/wildcardMatching","contentType":"directory"},{"name":"wordBreak","path":"algorithms/cpp/wordBreak","contentType":"directory"},{"name":"wordLadder","path":"algorithms/cpp/wordLadder","contentType":"directory"},{"name":"wordPattern","path":"algorithms/cpp/wordPattern","contentType":"directory"},{"name":"wordSearch","path":"algorithms/cpp/wordSearch","contentType":"directory"},{"name":"zigZagConversion","path":"algorithms/cpp/zigZagConversion","contentType":"directory"}],"totalCount":320},"algorithms":{"items":[{"name":"cpp","path":"algorithms/cpp","contentType":"directory"},{"name":"golang","path":"algorithms/golang","contentType":"directory"},{"name":"java","path":"algorithms/java","contentType":"directory"},{"name":"python","path":"algorithms/python","contentType":"directory"}],"totalCount":4},"":{" 4AEE items":[{"name":"algorithms","path":"algorithms","contentType":"directory"},{"name":"database","path":"database","contentType":"directory"},{"name":"scripts","path":"scripts","contentType":"directory"},{"name":"shell","path":"shell","contentType":"directory"},{"name":".gitconfig","path":".gitconfig","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"}],"totalCount":7}},"fileTreeProcessingTime":20.358828,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":25997802,"defaultBranch":"master","name":"leetcode","ownerLogin":"pjq","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2014-10-31T01:54:39.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/87846?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"master","listCacheKey":"v0:1620049621.32255","canEdit":false,"refType":"branch","currentOid":"a9393efc33a1e4a44d11b1f2d60808a293e21a84"},"path":"algorithms/cpp/wordSearch/wordSearch.cpp","currentUser":null,"blob":{"rawLines":["// Source : https://oj.leetcode.com/problems/word-search/","// Author : Hao Chen","// Date : 2014-07-19","","/********************************************************************************** "," * "," * Given a 2D board and a word, find if the word exists in the grid."," * "," * The word can be constructed from letters of sequentially adjacent cell, "," * where \"adjacent\" cells are those horizontally or vertically neighboring. "," * The same letter cell may not be used more than once."," * "," * For example,"," * Given board = "," * "," * ["," * [\"ABCE\"],"," * [\"SFCS\"],"," * [\"ADEE\"]"," * ]"," * "," * word = \"ABCCED\", -\u003e returns true,"," * word = \"SEE\", -\u003e returns true,"," * word = \"ABCB\", -\u003e returns false."," * "," * "," **********************************************************************************/","","#include \u003ciostream\u003e","#include \u003cvector\u003e","#include \u003cstring\u003e","using namespace std;","","bool exist(vector\u003cvector\u003cchar\u003e \u003e \u0026board, string\u0026 word, int idx, int row, int col) {"," if ( row\u003c0 || row\u003e=board.size() ||"," col\u003c0 || col\u003e=board[0].size() ||"," board[row][col] != word[idx]) {"," return false;"," }","",""," if (idx+1 == word.size()) return true;",""," //replace to a special char to avoid duplication."," board[row][col] = '\\0';",""," if ( exist(board, word, idx+1, row+1, col ) ||"," exist(board, word, idx+1, row-1, col ) ||"," exist(board, word, idx+1, row, col+1 ) ||"," exist(board, word, idx+1, row, col-1 ) ) {"," return true;"," }",""," //restore the char"," board[row][col] = word[idx];",""," return false;","}","","bool exist(vector\u003cvector\u003cchar\u003e \u003e \u0026board, string word) {"," if (board.size()\u003c=0 || word.size()\u003c=0) return false;"," int row = board.size();"," int col = board[0].size();",""," for(int i=0; i\u003cboard.size(); i++) {"," for(int j=0; j\u003cboard[i].size(); j++){"," if ( board[i][j]==word[0] ){"," if( exist(board, word, 0, i, j) ){"," return true;"," }"," }"," }"," }"," return false;","}","","vector\u003c vector\u003cchar\u003e \u003e buildBoard(char b[][5], int r, int c) {"," vector\u003c vector\u003cchar\u003e \u003e board;"," for (int i=0; i\u003cr; i++){"," vector\u003cchar\u003e v(b[i], b[i]+c);"," cout \u003c\u003c b[i] \u003c\u003c endl;"," board.push_back(v);"," }"," cout \u003c\u003c \"----------\" \u003c\u003c endl; "," return board;","}","","int main(int argc, char** argv)","{"," string s;"," char b[3][5] ={ \"ABCE\", \"SFCS\", \"ADEE\" };"," vector\u003c vector\u003cchar\u003e \u003e board = buildBoard(b, 3, 4);",""," s = \"SEE\";"," cout \u003c\u003c s \u003c\u003c \":\" \u003c\u003c exist(board, s) \u003c\u003c endl; ",""," s = \"ABCCED\";"," cout \u003c\u003c s \u003c\u003c \":\" \u003c\u003c exist(board, s) \u003c\u003c endl; ",""," s = \"ABCB\";"," cout \u003c\u003c s \u003c\u003c \":\" \u003c\u003c exist(board, s) \u003c\u003c endl; ","",""," if (argc\u003e1){"," s = argv[1];"," cout \u003c\u003c s \u003c\u003c \":\" \u003c\u003c exist(board, s) \u003c\u003c endl; "," }",""," cout \u003c\u003c endl \u003c\u003c \"----------\" \u003c\u003c endl; "," char b1[3][5] ={ \"CAA\", \"AAA\", \"BCD\" };"," board = buildBoard(b1, 3, 3);",""," s = \"AAB\";"," cout \u003c\u003c s \u003c\u003c \":\" \u003c\u003c exist(board, s) \u003c\u003c endl; ","",""," cout \u003c\u003c endl \u003c\u003c \"----------\" \u003c\u003c endl; "," char b2[3][5] ={ \"ABCE\", \"SFES\", \"ADEE\" };"," board = buildBoard(b2, 3, 4);",""," s = \"ABCESEEEFS\";"," cout \u003c\u003c s \u003c\u003c \":\" \u003c\u003c exist(board, s) \u003c\u003c endl; ",""," cout \u003c\u003c endl \u003c\u003c \"----------\" \u003c\u003c endl; "," char b3[3][5] ={ \"aaaa\", \"aaaa\", \"aaaa\" };"," board = buildBoard(b3, 3, 4);",""," s = \"aaaaaaaaaaaaa\";"," cout \u003c\u003c s \u003c\u003c \":\" \u003c\u003c exist(board, s) \u003c\u003c endl; ",""," return 0;","}"],"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/pjq/leetcode/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"wordSearch.cpp","displayUrl":"https://github.com/pjq/leetcode/blob/master/algorithms/cpp/wordSearch/wordSearch.cpp?raw=true","headerInfo":{"blobSize":"3.28 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"1aa8a6c","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Fpjq%2Fleetcode%2Fblob%2Fmaster%2Falgorithms%2Fcpp%2FwordSearch%2FwordSearch.cpp","isCSV":false,"isRichtext":false,"toc":null,"lineInfo":{"truncatedLoc":"132","truncatedSloc":"106"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"C++","languageID":43,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/pjq/leetcode/blob/master/algorithms/cpp/wordSearch/wordSearch.cpp","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/pjq/leetcode/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/pjq/leetcode/raw/refs/heads/master/algorithms/cpp/wordSearch/wordSearch.cpp","renderImageOrRaw":false,"richText":null,"renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":null},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/pjq/leetcode/branches":{"post":"fY_MBQS3mGcCtKv6RQIJbgeb-DGJB9wLfjvR11iUszdb44NXwtB0JT7bolPl8P_VYzbBRU8Rw1m_AqZ9ImuNoA"},"/repos/preferences":{"post":"q6yVZkxhuyfwhm7TesOg0leOi1A7xSCnm58Id5gPhZNH41OXszm80vrnN76FTdUbv-qbC7gK6YAtD7uhX-N52A"}}},"title":"leetcode/algorithms/cpp/wordSearch/wordSearch.cpp at master · pjq/leetcode","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1b17b3e7786a.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0