├── 502_IPO ├── 502_IPO.cpp └── 502_IPO.vcxproj.filters ├── Sort ├── InsertSort.cpp ├── RadixSort.cpp └── MergeSort.cpp ├── 135_Candy ├── 135_Candy.cpp └── 135_Candy.vcxproj.filters ├── 218_SkyLine ├── 218_SkyLine.cpp └── 218_SkyLine.vcxproj.filters ├── 089_GrayCode ├── 089_GrayCode.cpp └── 089_GrayCode.vcxproj.filters ├── 146_LRUCache ├── 146_LRUCache.cpp └── 146_LRUCache.vcxproj.filters ├── 372_SuperPow ├── 372_SuperPow.cpp └── 372_SuperPow.vcxproj.filters ├── 076_MinWindow ├── 076_MinWindow.cpp └── 076_MinWindow.vcxproj.filters ├── 149_MaxPoints ├── 149_MaxPoints.cpp └── 149_MaxPoints.vcxproj.filters ├── 222_CountNodes ├── 222_CountNodes.cpp └── 222_CountNodes.vcxproj.filters ├── 454_FourSumII ├── 454_FourSumII.cpp └── 454_FourSumII.vcxproj.filters ├── 095_UniqueBSTII ├── 095_UniqueBSTII.cpp └── 095_UniqueBSTII.vcxproj.filters ├── 098_ValidateBST ├── 098_ValidateBST.cpp └── 098_ValidateBST.vcxproj.filters ├── 143_ReorderList ├── 143_ReorderList.cpp └── 143_ReorderList.vcxproj.filters ├── 188_MaxProfitIV ├── 188_MaxProfitIV.cpp └── 188_MaxProfitIV.vcxproj.filters ├── 126_WordLadderII ├── 126_WordLadderII.cpp └── 126_WordLadderII.vcxproj.filters ├── 151_ReverseWords └── 151_ReverseWords.cpp ├── 232_StackToQueue └── 232_StackToQueue.cpp ├── 282_AddOperators └── 282_AddOperators.cpp ├── 002_AddTwoNumbers └── 002_AddTwoNumbers.cpp ├── 021_MergeTwoLists ├── 021_MergeTwoLists.cpp └── 021_MergeTwoLists.vcxproj.filters ├── 025_ReverseKGroup ├── 025_ReverseKGroup.cpp └── 025_ReverseKGroup.vcxproj.filters ├── 030_FindSubstring ├── 030_FindSubstring.cpp └── 030_FindSubstring.vcxproj.filters ├── 327_CountRangeSum └── 327_CountRangeSum.cpp ├── 330_PatchingArray └── 330_PatchingArray.cpp ├── 407_TrapRainWater └── 407_TrapRainWater.cpp ├── 450_DeleteNodeBST └── 450_DeleteNodeBST.cpp ├── 109_SortedListToBST └── 109_SortedListToBST.cpp ├── 207_CourseSchedule └── 207_CourseSchedule.cpp ├── 209_MinSubArrayLen └── 209_MinSubArrayLen.cpp ├── 321_CreateMaxNumber └── 321_CreateMaxNumber.cpp ├── 336_PalindromePairs └── 336_PalindromePairs.cpp ├── 019_RemoveNthFromEnd └── 019_RemoveNthFromEnd.cpp ├── 044_WildcardMatching └── 044_WildcardMatching.cpp ├── 085_MaximalRectangle └── 085_MaximalRectangle.cpp ├── 210_CourseScheduleII └── 210_CourseScheduleII.cpp ├── 239_MaxSlidingWindow └── 239_MaxSlidingWindow.cpp ├── 395_LongestSubstring └── 395_LongestSubstring.cpp ├── 105_BuildTreePreorder └── 105_BuildTreePreorder.cpp ├── 300_LongestIncreasing └── 300_LongestIncreasing.cpp ├── 005_LongestPalindromic └── 005_LongestPalindromic.cpp ├── 032_LongestParentheses └── 032_LongestParentheses.cpp ├── 082_DeleteDuplicatesII └── 082_DeleteDuplicatesII.cpp ├── 145_PostorderTraversal └── 145_PostorderTraversal.cpp ├── 313_NthSuperUglyNumber └── 313_NthSuperUglyNumber.cpp ├── README.md ├── 041_FirstMissingPositive └── 041_FirstMissingPositive.cpp ├── 316_RemoveDuplicateLetters └── 316_RemoveDuplicateLetters.cpp ├── 301_RemoveInvalidParentheses └── 301_RemoveInvalidParentheses.cpp ├── 292_NimGame ├── 292_NimGame.cpp └── 292_NimGame.vcxproj.filters ├── 026_RemoveDuplicates └── 026_RemoveDuplicates.cpp ├── 027_RemoveElement ├── 027_RemoveElement.cpp └── 027_RemoveElement.vcxproj.filters ├── 172_FactorialTrailingZeros └── 172_FactorialTrailingZeros.cpp ├── 371_SumTwoIntegers └── 371_SumTwoIntegers.cpp ├── 191_HammingWeight └── 191_HammingWeight.cpp ├── 201_RangeBitwiseAnd └── 201_RangeBitwiseAnd.cpp ├── 070_ClimbingStairs └── 070_ClimbingStairs.cpp ├── 231_PowerTwo ├── 231_PowerTwo.cpp └── 231_PowerTwo.vcxproj.filters ├── 190_ReverseBits ├── 190_ReverseBits.cpp └── 190_ReverseBits.vcxproj.filters ├── 263_UglyNumber ├── 263_UglyNumber.cpp └── 263_UglyNumber.vcxproj.filters ├── 233_CountDigitOne └── 233_CountDigitOne.cpp ├── 275_HindexII ├── 275_HindexII.cpp └── 275_HindexII.vcxproj.filters ├── 062_UniquePaths ├── 062_UniquePaths.cpp └── 062_UniquePaths.vcxproj.filters ├── 096_UniqueBST ├── 096_UniqueBST.cpp └── 096_UniqueBST.vcxproj.filters ├── 237_DeleteListNode └── 237_DeleteListNode.cpp ├── 283_MoveZeros ├── 283_MoveZeros.cpp └── 283_MoveZeros.vcxproj.filters ├── 326_PowerThree ├── 326_PowerThree.cpp └── 326_PowerThree.vcxproj.filters ├── 387_FirstUniqueChar └── 387_FirstUniqueChar.cpp ├── 000_II └── 001_TwoSum.cc ├── 226_InvertBinaryTree └── 226_InvertBinaryTree.cpp ├── 279_PerfectSquares └── 279_PerfectSquares.cpp ├── 377_CombinationSumIV └── 377_CombinationSumIV.cpp ├── 189_RotateArray ├── 189_RotateArray.cpp └── 189_RotateArray.vcxproj.filters ├── 121_MaxProfit ├── 121_MaxProfit.cpp └── 121_MaxProfit.vcxproj.filters ├── 167_TwoSumSorted └── 167_TwoSumSorted.cpp ├── 389_FindDifference └── 389_FindDifference.cpp ├── 223_RectangleArea └── 223_RectangleArea.cpp ├── 238_ProductExceptSelf └── 238_ProductExceptSelf.cpp ├── 367_ValidPerfectSquare └── 367_ValidPerfectSquare.cpp ├── 324_WiggleSortII └── 324_WiggleSortII.cpp ├── 383_RansomNote ├── 383_RansomNote.cpp └── 383_RansomNote.vcxproj.filters ├── 141_LinkedListCycle └── 141_LinkedListCycle.cpp ├── 392_IsSubsequence └── 392_IsSubsequence.cpp ├── 122_MaxProfitII ├── 122_MaxProfitII.cpp └── 122_MaxProfitII.vcxproj.filters ├── 242_ValidAnagram └── 242_ValidAnagram.cpp ├── 206_ReverseLinkedList └── 206_ReverseLinkedList.cpp ├── 309_MaxProfitCooldown └── 309_MaxProfitCooldown.cpp ├── 215_FindKthLargest └── 215_FindKthLargest.cpp ├── 094_InorderTraversal └── 094_InorderTraversal.cpp ├── 120_MinSumTriangle └── 120_MinSumTriangle.cpp ├── 134_GasStation ├── 134_GasStation.cpp └── 134_GasStation.vcxproj.filters ├── 386_LexicalOrder └── 386_LexicalOrder.cpp ├── 268_MissingNumber └── 268_MissingNumber.cpp ├── 139_WordBreak ├── 139_WordBreak.cpp └── 139_WordBreak.vcxproj.filters ├── 202_HappyNumber ├── 202_HappyNumber.cpp └── 202_HappyNumber.vcxproj.filters ├── 396_RotateFunction └── 396_RotateFunction.cpp ├── 219_ContainsDuplicateII └── 219_ContainsDuplicateII.cpp ├── 075_SortColors ├── 075_SortColors.cpp └── 075_SortColors.vcxproj.filters ├── 007_ReverseInteger └── 007_ReverseInteger.cpp ├── 077_Combinations ├── 077_Combinations.cpp └── 077_Combinations.vcxproj.filters ├── 259_ThreeSumSmaller └── 259_ThreeSumSmaller.cpp ├── 303_RangeSumQueryI └── 303_RangeSumQueryI.cpp ├── 169_MajorityElement └── 169_MajorityElement.cpp ├── 022_GenerateParentheses └── 022_GenerateParentheses.cpp ├── 220_ContainsDuplicateIII └── 220_ContainsDuplicateIII.cpp ├── 001_TwoSum └── 001_TwoSum.cpp ├── 035_InsertPosition └── 035_InsertPosition.cpp ├── 078_Subsets ├── 078_Subsets.cpp └── 078_Subsets.vcxproj.filters ├── 136_SingleNumber ├── 136_SingleNumber.cpp └── 136_SingleNumber.vcxproj.filters ├── 243_ShortestDistance └── 243_ShortestDistance.cpp ├── OnlineJudge └── OnlineJudge.vcxproj.filters ├── 104_MaxDepth ├── 104_MaxDepth.cpp └── 104_MaxDepth.vcxproj.filters ├── 050_Pow ├── 050_Pow.cpp └── 050_Pow.vcxproj.filters ├── 152_MaxProduct ├── 152_MaxProduct.cpp └── 152_MaxProduct.vcxproj.filters ├── 029_DivideTwoIntegers └── 029_DivideTwoIntegers.vcxproj.filters ├── 084_LargestRectangleArea └── 084_LargestRectangleArea.cpp ├── 394_DecodeString └── 394_DecodeString.cpp ├── 115_DistinctSubsequences └── 115_DistinctSubseqences.cpp ├── 080_RemoveDuplicatesII └── 080_RemoveDuplicatesII.cpp ├── 006_ZigZagConversion └── 006_ZigZagConversion.cpp ├── 011_MaxArea ├── 011_MaxArea.cpp └── 011_MaxArea.vcxproj.filters ├── 088_MergeSortedArray └── 088_MergeSortedArray.cpp ├── 161_OneEditDistance └── 161_OneEditDistance.cpp ├── 240_SearchMatrixII └── 240_SearchMatrixII.cpp ├── 031_NextPermutation └── 031_NextPermutation.cpp ├── 170_TwoSumIII ├── 170_TwoSumIII.cpp └── 170_TwoSumIII.vcxproj.filters ├── 155_MinStack ├── 155_MinStack.cpp └── 155_MinStack.vcxproj.filters ├── 213_HouseRobberII └── 213_HouseRobberII.cpp ├── 042_TrappingRainWater └── 042_TrappingRainWater.cpp ├── 216_CombinationSumIII └── 216_CombinationSumIII.cpp ├── 376_WiggleMaxLength └── 376_WiggleMaxLength.cpp ├── 198_HouseRobber ├── 198_HouseRobber.cpp └── 198_HouseRobber.vcxproj.filters ├── 008_Atoi ├── 008_Atoi.cpp └── 008_Atoi.vcxproj.filters ├── 040_CombinationSumII └── 040_CombinationSumII.cpp ├── 081_SearchRotatedArrayII └── 081_SearchRotatedArrayII.cpp ├── 234_PalindromeLinkedList └── 234_PalindromeLinkedList.cpp ├── 244_ShortestDistanceII └── 244_ShortestDistanceII.cpp ├── 299_BullsAndCows └── 299_BullsAndCows.cpp ├── 036_ValidSudoku ├── 036_ValidSudoku.cpp └── 036_ValidSudoku.vcxproj.filters ├── 064_MinPathSum ├── 064_MinPathSum.cpp └── 064_MinPathSum.vcxproj.filters ├── 582_KillProcess ├── 582_KillProcess.cpp └── 582_KillProcess.vcxproj.filters ├── 069_Sqrt └── 069_Sqrt.vcxproj.filters ├── 090_SubsetsII ├── 090_SubsetsII.cpp └── 090_SubsetsII.vcxproj.filters ├── 028_StrStr └── 028_StrStr.vcxproj.filters ├── 132_MinCut └── 132_MinCut.vcxproj.filters ├── 228_SummaryRanges └── 228_SummaryRanges.cpp ├── 274_Hindex └── 274_Hindex.vcxproj.filters ├── 287_FindDuplicate └── 287_FindDuplicate.cpp ├── 015_ThreeSum └── 015_ThreeSum.vcxproj.filters ├── 018_FourSum └── 018_FourSum.vcxproj.filters ├── 051_NQueens └── 051_NQueens.vcxproj.filters ├── 055_JumpGame └── 055_JumpGame.vcxproj.filters ├── 112_PathSum └── 112_PathSum.vcxproj.filters ├── 148_SortList └── 148_SortList.vcxproj.filters ├── 179_LargestNumber └── 179_LargestNumber.cpp ├── 052_NQueensII └── 052_NQueensII.vcxproj.filters ├── 067_AddBinary └── 067_AddBinary.vcxproj.filters ├── 113_PathSumII └── 113_PathSumII.vcxproj.filters ├── 311_SparseMatrixMultiplication └── 311_SparseMatrixMultiplication.cpp ├── 380_RandomSet └── 380_RandomSet.vcxproj.filters ├── 009_PalindromeNumber └── 009_PalindromeNumber.cpp ├── 023_MergeKLists └── 023_MergeKLists.vcxproj.filters ├── 034_SearchRange └── 034_SearchRange.vcxproj.filters ├── 045_JumpGameII └── 045_JumpGameII.vcxproj.filters ├── 046_Permutations ├── 046_Permutations.cpp └── 046_Permutations.vcxproj.filters ├── 048_RotateImage └── 048_RotateImage.vcxproj.filters ├── 053_MaxSubArray └── 053_MaxSubArray.vcxproj.filters ├── 061_RotateList └── 061_RotateList.vcxproj.filters ├── 079_WordSearch └── 079_WordSearch.vcxproj.filters ├── 091_DecodeWays └── 091_DecodeWays.vcxproj.filters ├── 099_RecoverBST └── 099_RecoverBST.vcxproj.filters ├── 102_LevelOrder └── 102_LevelOrder.vcxproj.filters ├── 124_MaxPathSum └── 124_MaxPathSum.vcxproj.filters ├── 127_WordLadder └── 127_WordLadder.vcxproj.filters ├── 129_SumNumbers └── 129_SumNumbers.vcxproj.filters ├── 133_CloneGraph └── 133_CloneGraph.vcxproj.filters ├── 140_WordBreakII └── 140_WordBreakII.vcxproj.filters ├── 164_Maximum_Gap └── 164_Maximum_Gap.vcxproj.filters ├── 173_BSTIterator └── 173_BSTIterator.vcxproj.filters ├── 174_DungeonGame └── 174_DungeonGame.vcxproj.filters ├── 204_CountPrimes └── 204_CountPrimes.vcxproj.filters ├── 208_PrefixTree └── 208_PrefixTree.vcxproj.filters ├── 290_WordPattern └── 290_WordPattern.vcxproj.filters ├── 322_CoinChange └── 322_CoinChange.vcxproj.filters ├── 378_KthSmallest └── 378_KthSmallest.vcxproj.filters ├── 437_PathSumIII └── 437_PathSumIII.vcxproj.filters ├── 524_LongestWord └── 524_LongestWord.vcxproj.filters ├── 616_AddBoldTag └── 616_AddBoldTag.vcxproj.filters ├── 037_SudokuSolver └── 037_SudokuSolver.vcxproj.filters ├── 049_GroupAnagrams └── 049_GroupAnagrams.vcxproj.filters ├── 054_SpiralMatrix └── 054_SpiralMatrix.vcxproj.filters ├── 063_UniquePathII └── 063_UniquePathII.vcxproj.filters ├── 072_EditDistance └── 072_EditDistance.vcxproj.filters ├── 074_SearchMatrix └── 074_SearchMatrix.vcxproj.filters ├── 086_PartitionList └── 086_PartitionList.vcxproj.filters ├── 087_ScrambleString └── 087_ScrambleString.cpp ├── 101_SymmetricTree └── 101_SymmetricTree.vcxproj.filters └── 123_MaxProfitIII └── 123_MaxProfitIII.vcxproj.filters /502_IPO/502_IPO.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/502_IPO/502_IPO.cpp -------------------------------------------------------------------------------- /Sort/InsertSort.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/Sort/InsertSort.cpp -------------------------------------------------------------------------------- /135_Candy/135_Candy.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/135_Candy/135_Candy.cpp -------------------------------------------------------------------------------- /218_SkyLine/218_SkyLine.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/218_SkyLine/218_SkyLine.cpp -------------------------------------------------------------------------------- /089_GrayCode/089_GrayCode.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/089_GrayCode/089_GrayCode.cpp -------------------------------------------------------------------------------- /146_LRUCache/146_LRUCache.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/146_LRUCache/146_LRUCache.cpp -------------------------------------------------------------------------------- /372_SuperPow/372_SuperPow.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/372_SuperPow/372_SuperPow.cpp -------------------------------------------------------------------------------- /076_MinWindow/076_MinWindow.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/076_MinWindow/076_MinWindow.cpp -------------------------------------------------------------------------------- /149_MaxPoints/149_MaxPoints.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/149_MaxPoints/149_MaxPoints.cpp -------------------------------------------------------------------------------- /222_CountNodes/222_CountNodes.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/222_CountNodes/222_CountNodes.cpp -------------------------------------------------------------------------------- /454_FourSumII/454_FourSumII.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/454_FourSumII/454_FourSumII.cpp -------------------------------------------------------------------------------- /095_UniqueBSTII/095_UniqueBSTII.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/095_UniqueBSTII/095_UniqueBSTII.cpp -------------------------------------------------------------------------------- /098_ValidateBST/098_ValidateBST.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/098_ValidateBST/098_ValidateBST.cpp -------------------------------------------------------------------------------- /143_ReorderList/143_ReorderList.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/143_ReorderList/143_ReorderList.cpp -------------------------------------------------------------------------------- /188_MaxProfitIV/188_MaxProfitIV.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/188_MaxProfitIV/188_MaxProfitIV.cpp -------------------------------------------------------------------------------- /126_WordLadderII/126_WordLadderII.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/126_WordLadderII/126_WordLadderII.cpp -------------------------------------------------------------------------------- /151_ReverseWords/151_ReverseWords.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/151_ReverseWords/151_ReverseWords.cpp -------------------------------------------------------------------------------- /232_StackToQueue/232_StackToQueue.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/232_StackToQueue/232_StackToQueue.cpp -------------------------------------------------------------------------------- /282_AddOperators/282_AddOperators.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/282_AddOperators/282_AddOperators.cpp -------------------------------------------------------------------------------- /002_AddTwoNumbers/002_AddTwoNumbers.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/002_AddTwoNumbers/002_AddTwoNumbers.cpp -------------------------------------------------------------------------------- /021_MergeTwoLists/021_MergeTwoLists.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/021_MergeTwoLists/021_MergeTwoLists.cpp -------------------------------------------------------------------------------- /025_ReverseKGroup/025_ReverseKGroup.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/025_ReverseKGroup/025_ReverseKGroup.cpp -------------------------------------------------------------------------------- /030_FindSubstring/030_FindSubstring.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/030_FindSubstring/030_FindSubstring.cpp -------------------------------------------------------------------------------- /327_CountRangeSum/327_CountRangeSum.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/327_CountRangeSum/327_CountRangeSum.cpp -------------------------------------------------------------------------------- /330_PatchingArray/330_PatchingArray.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/330_PatchingArray/330_PatchingArray.cpp -------------------------------------------------------------------------------- /407_TrapRainWater/407_TrapRainWater.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/407_TrapRainWater/407_TrapRainWater.cpp -------------------------------------------------------------------------------- /450_DeleteNodeBST/450_DeleteNodeBST.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/450_DeleteNodeBST/450_DeleteNodeBST.cpp -------------------------------------------------------------------------------- /109_SortedListToBST/109_SortedListToBST.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/109_SortedListToBST/109_SortedListToBST.cpp -------------------------------------------------------------------------------- /207_CourseSchedule/207_CourseSchedule.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/207_CourseSchedule/207_CourseSchedule.cpp -------------------------------------------------------------------------------- /209_MinSubArrayLen/209_MinSubArrayLen.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/209_MinSubArrayLen/209_MinSubArrayLen.cpp -------------------------------------------------------------------------------- /321_CreateMaxNumber/321_CreateMaxNumber.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/321_CreateMaxNumber/321_CreateMaxNumber.cpp -------------------------------------------------------------------------------- /336_PalindromePairs/336_PalindromePairs.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/336_PalindromePairs/336_PalindromePairs.cpp -------------------------------------------------------------------------------- /019_RemoveNthFromEnd/019_RemoveNthFromEnd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/019_RemoveNthFromEnd/019_RemoveNthFromEnd.cpp -------------------------------------------------------------------------------- /044_WildcardMatching/044_WildcardMatching.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/044_WildcardMatching/044_WildcardMatching.cpp -------------------------------------------------------------------------------- /085_MaximalRectangle/085_MaximalRectangle.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/085_MaximalRectangle/085_MaximalRectangle.cpp -------------------------------------------------------------------------------- /210_CourseScheduleII/210_CourseScheduleII.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/210_CourseScheduleII/210_CourseScheduleII.cpp -------------------------------------------------------------------------------- /239_MaxSlidingWindow/239_MaxSlidingWindow.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/239_MaxSlidingWindow/239_MaxSlidingWindow.cpp -------------------------------------------------------------------------------- /395_LongestSubstring/395_LongestSubstring.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/395_LongestSubstring/395_LongestSubstring.cpp -------------------------------------------------------------------------------- /105_BuildTreePreorder/105_BuildTreePreorder.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/105_BuildTreePreorder/105_BuildTreePreorder.cpp -------------------------------------------------------------------------------- /300_LongestIncreasing/300_LongestIncreasing.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/300_LongestIncreasing/300_LongestIncreasing.cpp -------------------------------------------------------------------------------- /005_LongestPalindromic/005_LongestPalindromic.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/005_LongestPalindromic/005_LongestPalindromic.cpp -------------------------------------------------------------------------------- /032_LongestParentheses/032_LongestParentheses.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/032_LongestParentheses/032_LongestParentheses.cpp -------------------------------------------------------------------------------- /082_DeleteDuplicatesII/082_DeleteDuplicatesII.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/082_DeleteDuplicatesII/082_DeleteDuplicatesII.cpp -------------------------------------------------------------------------------- /145_PostorderTraversal/145_PostorderTraversal.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/145_PostorderTraversal/145_PostorderTraversal.cpp -------------------------------------------------------------------------------- /313_NthSuperUglyNumber/313_NthSuperUglyNumber.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/313_NthSuperUglyNumber/313_NthSuperUglyNumber.cpp -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LeetCode 2 | [LeetCode Online Judge](https://leetcode.com/problemset/algorithms/) 3 | 4 | Solution by [P-Chao](http://www.p-chao.com) 5 | -------------------------------------------------------------------------------- /041_FirstMissingPositive/041_FirstMissingPositive.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/041_FirstMissingPositive/041_FirstMissingPositive.cpp -------------------------------------------------------------------------------- /316_RemoveDuplicateLetters/316_RemoveDuplicateLetters.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/316_RemoveDuplicateLetters/316_RemoveDuplicateLetters.cpp -------------------------------------------------------------------------------- /301_RemoveInvalidParentheses/301_RemoveInvalidParentheses.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Ewenwan/LeetCode/HEAD/301_RemoveInvalidParentheses/301_RemoveInvalidParentheses.cpp -------------------------------------------------------------------------------- /292_NimGame/292_NimGame.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Solution { 6 | public: 7 | bool canWinNim(int n) { 8 | return (n & 3); 9 | } 10 | }; 11 | 12 | int main(int argc, char *argv[]){ 13 | Solution s; 14 | cout << s.canWinNim(3) << endl; 15 | system("pause"); 16 | return 0; 17 | } -------------------------------------------------------------------------------- /026_RemoveDuplicates/026_RemoveDuplicates.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int removeDuplicates(vector& nums) { 9 | const int n = nums.size(); 10 | if (0 == n) return 0; 11 | int p = 1; 12 | for (int i = 1; i 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int removeElement(vector& nums, int val) { 9 | int cnt = 0; 10 | const int n = nums.size(); 11 | for (int i = 0; i < n; ++i){ 12 | if (nums[i] == val){ 13 | cnt++; 14 | } 15 | else{ 16 | nums[i - cnt] = nums[i]; 17 | } 18 | } 19 | return n - cnt; 20 | } 21 | }; -------------------------------------------------------------------------------- /172_FactorialTrailingZeros/172_FactorialTrailingZeros.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Solution { 6 | public: 7 | int trailingZeroes(int n) { 8 | int cnt = 0; 9 | while (n > 0){ 10 | n = n / 5; 11 | cnt += n; 12 | } 13 | return cnt; 14 | } 15 | }; 16 | 17 | int main(int argc, char *argv[]){ 18 | Solution s; 19 | cout << s.trailingZeroes(25) << endl; 20 | system("pause"); 21 | return 0; 22 | } -------------------------------------------------------------------------------- /371_SumTwoIntegers/371_SumTwoIntegers.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Solution { 6 | public: 7 | int getSum(int a, int b) { 8 | int nr = a ^ b; 9 | int ad = ((a & b) << 1); 10 | if (nr & ad){ 11 | return getSum(nr, ad); 12 | } 13 | return (nr | ad); 14 | } 15 | }; 16 | 17 | int main(int argc, char *argv[]){ 18 | Solution s; 19 | cout << s.getSum(0, 1) << endl; 20 | system("pause"); 21 | return 0; 22 | } -------------------------------------------------------------------------------- /191_HammingWeight/191_HammingWeight.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int hammingWeight(uint32_t n) { 9 | int cnt = 0; 10 | while (n > 0){ 11 | if (n & 0x01){ 12 | cnt++; 13 | } 14 | n = n >> 1; 15 | } 16 | return cnt; 17 | } 18 | }; 19 | 20 | int main(int argc, char *argv[]){ 21 | Solution s; 22 | cout << s.hammingWeight(1) << endl; 23 | system("pause"); 24 | return 0; 25 | } -------------------------------------------------------------------------------- /201_RangeBitwiseAnd/201_RangeBitwiseAnd.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int rangeBitwiseAnd(int m, int n) { 9 | int bit = 0; 10 | while (m!=n) { 11 | m = m >> 1; 12 | n = n >> 1; 13 | bit++; 14 | } 15 | return n << bit; 16 | } 17 | }; 18 | 19 | int main(int argc, char *argv[]){ 20 | Solution s; 21 | cout << s.rangeBitwiseAnd(5, 7) << endl; 22 | system("pause"); 23 | return 0; 24 | } -------------------------------------------------------------------------------- /070_ClimbingStairs/070_ClimbingStairs.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int climbStairs(int n) { 9 | int cur = 1, pprev = 0, prev = 1; 10 | for (int i = 1; i <= n; ++i){ 11 | cur = prev + pprev; 12 | pprev = prev; 13 | prev = cur; 14 | } 15 | return cur; 16 | } 17 | }; 18 | 19 | int main(int argc, char *argv[]){ 20 | Solution s; 21 | cout << s.climbStairs(0) << endl; 22 | system("pause"); 23 | return 0; 24 | } -------------------------------------------------------------------------------- /231_PowerTwo/231_PowerTwo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Solution { 6 | public: 7 | bool isPowerOfTwo(int n) { 8 | while (n > 0){ 9 | if ((n & 0x01)){ 10 | if (n == 1){ 11 | return true; 12 | } else{ 13 | return false; 14 | } 15 | } 16 | n = n >> 1; 17 | } 18 | return false; 19 | } 20 | }; 21 | 22 | int main(int argc, char *argv[]){ 23 | Solution s; 24 | cout << s.isPowerOfTwo(8) << endl; 25 | system("pause"); 26 | return 0; 27 | } -------------------------------------------------------------------------------- /190_ReverseBits/190_ReverseBits.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | uint32_t reverseBits(uint32_t n) { 10 | uint32_t r = 0; 11 | int i = 32; 12 | while (i--){ 13 | int t = n & 0x01; 14 | r = r * 2 + t; 15 | n = n >> 1; 16 | } 17 | return r; 18 | } 19 | }; 20 | 21 | int main(int argc, char *argv[]){ 22 | Solution s; 23 | cout << s.reverseBits(43261596) << endl; 24 | system("pause"); 25 | return 0; 26 | } -------------------------------------------------------------------------------- /263_UglyNumber/263_UglyNumber.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | bool isUgly(int num) { 9 | int prime[3] = { 2, 3, 5 }; 10 | int i = 0; 11 | while (num > 1 && i < 3){ 12 | if (num % prime[i] == 0){ 13 | num = num / prime[i]; 14 | continue; 15 | } 16 | ++i; 17 | } 18 | return num == 1; 19 | } 20 | }; 21 | 22 | int main(int argc, char *argv[]){ 23 | Solution s; 24 | cout << s.isUgly(0) << endl; 25 | system("pause"); 26 | return 0; 27 | } -------------------------------------------------------------------------------- /233_CountDigitOne/233_CountDigitOne.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int countDigitOne(int n) { 9 | int ones = 0; 10 | for (long m = 1; m <= n; m *= 10){ 11 | long a = n / m, b = n % m; 12 | ones += (a + 8) / 10 * m; 13 | if (a % 10 == 1){ 14 | ones += b + 1; 15 | } 16 | } 17 | return ones; 18 | } 19 | }; 20 | 21 | int main(int argc, char *argv[]){ 22 | Solution s; 23 | cout << s.countDigitOne(130) << endl; 24 | system("pause"); 25 | return 0; 26 | } -------------------------------------------------------------------------------- /275_HindexII/275_HindexII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int hIndex(vector& citations) { 9 | const int n = citations.size(); 10 | int cnt = 0, i = 0; 11 | for (i = n - 1; i >= 0; --i){ 12 | if ((n - i) > citations[i]){ 13 | break; 14 | } 15 | } 16 | return (n - i - 1); 17 | } 18 | }; 19 | 20 | int main(int argc, char *argv[]){ 21 | Solution s; 22 | cout << s.hIndex(vector{0, 1, 3, 5, 6}) << endl; 23 | system("pause"); 24 | return 0; 25 | } -------------------------------------------------------------------------------- /062_UniquePaths/062_UniquePaths.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int uniquePaths(int m, int n) { 9 | vector> path(m, vector(n,1)); 10 | for (int i = 1; i < m; ++i){ 11 | for (int j = 1; j < n; ++j){ 12 | path[i][j] = path[i-1][j] + path[i][j-1]; 13 | } 14 | } 15 | return path[m-1][n-1]; 16 | } 17 | }; 18 | 19 | int main(int argc, char *argv[]){ 20 | Solution s; 21 | cout << s.uniquePaths(3, 7) << endl; 22 | system("pause"); 23 | return 0; 24 | } -------------------------------------------------------------------------------- /096_UniqueBST/096_UniqueBST.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int numTrees(int n) { 9 | if (n < 2){ 10 | return 1; 11 | } 12 | vector cnt(n+1, 0); 13 | cnt[1] = cnt[0] = 1; 14 | for (int i = 2; i <= n; ++i){ 15 | for (int j = 0; j < i; ++j){ 16 | cnt[i] += cnt[i-1-j] * cnt[j]; 17 | } 18 | } 19 | return cnt[n]; 20 | } 21 | }; 22 | 23 | int main(int argc, char *argv){ 24 | Solution s; 25 | cout << s.numTrees(3) << endl; 26 | system("pause"); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /237_DeleteListNode/237_DeleteListNode.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | struct ListNode { 6 | int val; 7 | ListNode *next; 8 | ListNode(int x) : val(x), next(NULL) {} 9 | }; 10 | 11 | class Solution { 12 | public: 13 | void deleteNode(ListNode* node) { 14 | if (!node || !node->next){ 15 | return; 16 | } 17 | node->val = node->next->val; 18 | node->next = node->next->next; 19 | return; 20 | } 21 | }; 22 | 23 | int main(int argc, char *argv[]){ 24 | Solution s; 25 | s.deleteNode(NULL); 26 | system("pause"); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /283_MoveZeros/283_MoveZeros.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | void moveZeroes(vector& nums) { 9 | const int n = nums.size(); 10 | for (int j = 0, i = 0; j < n; ++j){ 11 | if (nums[j]){ 12 | swap(nums[j], nums[i++]); 13 | } 14 | } 15 | return; 16 | } 17 | }; 18 | 19 | int main(int argc, char *argv[]){ 20 | Solution s; 21 | vector nums{0, 1, 0, 3, 12}; 22 | s.moveZeroes(nums); 23 | for (auto v : nums){ 24 | cout << v << ", "; 25 | } 26 | system("pause"); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /326_PowerThree/326_PowerThree.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | bool isPowerOfThree(int n) { 9 | while (n > 0){ 10 | if (n < 3){ 11 | if (n == 1){ 12 | return true; 13 | } else{ 14 | return false; 15 | } 16 | } 17 | int tmp = n; 18 | n = n / 3; 19 | if (tmp - 3 * n){ 20 | return false; 21 | } 22 | } 23 | return false; 24 | } 25 | }; 26 | 27 | int main(int argc, char *argv[]){ 28 | Solution s; 29 | cout << s.isPowerOfThree(10) << endl; 30 | system("pause"); 31 | return 0; 32 | } -------------------------------------------------------------------------------- /387_FirstUniqueChar/387_FirstUniqueChar.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int firstUniqChar(string s) { 10 | const int n = s.size(); 11 | int count[26] = {0}; 12 | for (auto c : s){ 13 | count[c - 'a']++; 14 | } 15 | for (int i = 0; i < n; ++i){ 16 | if (count[s[i]-'a'] == 1){ 17 | return i; 18 | } 19 | } 20 | return -1; 21 | } 22 | }; 23 | 24 | int main(int argc, char *argv[]){ 25 | Solution s; 26 | cout << s.firstUniqChar("leetcode") << endl; 27 | system("pause"); 28 | return 0; 29 | } -------------------------------------------------------------------------------- /000_II/001_TwoSum.cc: -------------------------------------------------------------------------------- 1 | class Solution { 2 | public: 3 | // 给定一个数组 nums ,和一个目标值target 4 | // 返回 数组中 和 为 target 的两个索引 5 | vector twoSum(vector& nums, int target) { 6 | const int n = nums.size();// 元素总数 7 | unordered_map hash;// 差,index 无序map 8 | for(int i = 0; i < n; ++i){ 9 | if(hash.end() != hash.find(target-nums[i]))// 找 目标差值 10 | { 11 | return {hash[target-nums[i]], i};//找到返回 两个元素的 索引 12 | } 13 | hash.insert({nums[i], i});// 没找到,插入map记录 差值,index 14 | } 15 | return {0, 1};// 默认返回 0,1 索引 16 | } 17 | }; 18 | -------------------------------------------------------------------------------- /226_InvertBinaryTree/226_InvertBinaryTree.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | struct TreeNode { 6 | int val; 7 | TreeNode *left; 8 | TreeNode *right; 9 | TreeNode(int x) : val(x), left(NULL), right(NULL) {} 10 | }; 11 | 12 | class Solution { 13 | public: 14 | TreeNode* invertTree(TreeNode* root) { 15 | if (root){ 16 | auto t = root->left; 17 | root->left = invertTree(root->right); 18 | root->right = invertTree(t); 19 | } 20 | return root; 21 | } 22 | }; 23 | 24 | int main(int argc, char *argv[]){ 25 | Solution s; 26 | auto t = s.invertTree(NULL); 27 | system("pause"); 28 | return 0; 29 | } -------------------------------------------------------------------------------- /279_PerfectSquares/279_PerfectSquares.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int numSquares(int n) { 10 | vector nums(n+1, INT_MAX); 11 | for (int i = 0; i*i <= n; ++i){ 12 | nums[i*i] = 1; 13 | } 14 | for (int a = 0; a <= n; ++a){ 15 | for (int b = 0; a+b*b <= n; ++b){ 16 | nums[a+b*b] = min(nums[a+b*b], nums[a] + 1); 17 | } 18 | } 19 | return nums[n]; 20 | } 21 | }; 22 | 23 | int main(int argc, char *argv[]){ 24 | Solution s; 25 | cout << s.numSquares(12) << endl; 26 | system("pause"); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /377_CombinationSumIV/377_CombinationSumIV.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int combinationSum4(vector& nums, int target) { 10 | vector dp(target+1, 0); 11 | dp[0] = 1; 12 | for (int i = 1; i <= target; ++i){ 13 | for (auto a : nums){ 14 | if (i >= a){ 15 | dp[i] += dp[i - a]; 16 | } 17 | } 18 | } 19 | return dp.back(); 20 | } 21 | }; 22 | 23 | int main(int argc, char *argv[]){ 24 | Solution s; 25 | cout << s.combinationSum4(vector{1, 2, 3}, 32) << endl; 26 | system("pause"); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /189_RotateArray/189_RotateArray.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | void rotate(vector& nums, int k) { 10 | const int n = nums.size(); 11 | if (k > n){ 12 | k = k % n; 13 | } 14 | k = n - k; 15 | reverse(nums.begin(), nums.begin() + k); 16 | reverse(nums.begin() + k, nums.end()); 17 | reverse(nums.begin(), nums.end()); 18 | return; 19 | } 20 | }; 21 | 22 | int main(int argc, char *argv[]){ 23 | Solution s; 24 | vector nums{ 1, 2, 3, 5, 7, 8 }; 25 | s.rotate(nums, 2); 26 | system("pause"); 27 | return 0; 28 | } 29 | -------------------------------------------------------------------------------- /121_MaxProfit/121_MaxProfit.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int maxProfit(vector& prices) { 10 | const int n = prices.size(); 11 | if (n == 0){ 12 | return 0; 13 | } 14 | 15 | int curMin = prices[0]; 16 | int ret = 0; 17 | for (int i = 1; i < n; ++i){ 18 | curMin = min(curMin, prices[i]); 19 | ret = max(ret, prices[i]-curMin); 20 | } 21 | return ret; 22 | } 23 | }; 24 | 25 | int main(int argc, char *argv[]){ 26 | Solution s; 27 | cout << s.maxProfit(vector{7, 1, 5, 3, 6, 4}); 28 | system("pause"); 29 | return 0; 30 | } -------------------------------------------------------------------------------- /167_TwoSumSorted/167_TwoSumSorted.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | vector twoSum(vector& numbers, int target) { 9 | const int n = numbers.size(); 10 | auto i = 0, j = (n - 1); 11 | while (i != j){ 12 | int t = numbers[i] + numbers[j]; 13 | if (t > target){ 14 | j--; 15 | } else if (t < target){ 16 | i++; 17 | } else{ 18 | return{i+1,j+1}; 19 | } 20 | } 21 | return{ 0, 0 }; 22 | } 23 | }; 24 | 25 | int main(int argc, char *argv[]){ 26 | Solution s; 27 | s.twoSum(vector{2, 7, 11, 15}, 9); 28 | system("pause"); 29 | return 0; 30 | } -------------------------------------------------------------------------------- /389_FindDifference/389_FindDifference.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | char findTheDifference(string s, string t) { 10 | int count[26] = { 0 }; 11 | for (auto c : s){ 12 | count[c - 'a']--; 13 | } 14 | for (auto c : t){ 15 | count[c - 'a']++; 16 | } 17 | for (int i = 0; i < 26; ++i){ 18 | if (count[i] > 0){ 19 | return 'a' + i; 20 | } 21 | } 22 | return 0; 23 | } 24 | }; 25 | 26 | int main(int argc, char *argv[]){ 27 | Solution s; 28 | cout << s.findTheDifference("abcd", "abcde") << endl; 29 | system("pause"); 30 | return 0; 31 | } -------------------------------------------------------------------------------- /223_RectangleArea/223_RectangleArea.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) { 9 | int xs = max(A, E); 10 | int xe = min(C, G); 11 | int ys = max(B, F); 12 | int ye = min(D, H); 13 | int overlap = 0; 14 | if (xs < xe && ys < ye){ 15 | overlap = (xe - xs) * (ye - ys); 16 | } 17 | return (C - A)*(D - B) + (G - E)*(H - F) - overlap; 18 | } 19 | }; 20 | 21 | int main(int argc, char *argv[]){ 22 | Solution s; 23 | cout << s.computeArea(-3, 0, 3, 4, 0, -1, 9, 2) << endl; 24 | system("pause"); 25 | return 0; 26 | } -------------------------------------------------------------------------------- /238_ProductExceptSelf/238_ProductExceptSelf.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | vector productExceptSelf(vector& nums) { 9 | const int n = nums.size(); 10 | int fromBegin = 1, fromLast = 1; 11 | vector res(n,1); 12 | 13 | for (int i = 0; i < n; ++i){ 14 | res[i] *= fromBegin; 15 | fromBegin *= nums[i]; 16 | res[n - 1 - i] *= fromLast; 17 | fromLast *= nums[n-1-i]; 18 | } 19 | return res; 20 | } 21 | }; 22 | 23 | int main(int argc, char *argv[]){ 24 | Solution s; 25 | s.productExceptSelf(vector{1, 2, 3, 4}); 26 | system("pause"); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /367_ValidPerfectSquare/367_ValidPerfectSquare.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | bool isPerfectSquare(int num) { 9 | if (num <= 0){ 10 | return false; 11 | } else if (num == 1){ 12 | return true; 13 | } 14 | const int a = num / 2; 15 | for (int i = 1; i <= a; ++i){ 16 | if (i*i > num){ 17 | return false; 18 | } 19 | if (i*i == num){ 20 | return true; 21 | } 22 | } 23 | return false; 24 | } 25 | }; 26 | 27 | int main(int argc, char *argv[]){ 28 | Solution s; 29 | cout << s.isPerfectSquare(16) << endl; 30 | system("pause"); 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /324_WiggleSortII/324_WiggleSortII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | void wiggleSort(vector& nums) { 10 | vector sorted(nums); 11 | sort(sorted.begin(), sorted.end()); 12 | for (int i = nums.size() - 1, j = 0, k = i / 2 + 1; i >= 0; --i){ 13 | nums[i] = sorted[i & 1 ? k++ : j++]; 14 | } 15 | return; 16 | } 17 | }; 18 | 19 | int main(int argc, char *argv[]){ 20 | Solution s; 21 | vector nums{ 1, 2, 3, 4, 5, 2, 1, 1 }; 22 | s.wiggleSort(nums); 23 | for (auto v : nums){ 24 | cout << v << ", "; 25 | } 26 | system("pause"); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /383_RansomNote/383_RansomNote.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | bool canConstruct(string ransomNote, string magazine) { 10 | int count[26] = {0}; 11 | for (auto c : ransomNote){ 12 | count[c-'a']--; 13 | } 14 | for (auto c : magazine){ 15 | count[c - 'a']++; 16 | } 17 | for (int i = 0; i < 26; ++i){ 18 | if (count[i] < 0){ 19 | return false; 20 | } 21 | } 22 | return true; 23 | } 24 | }; 25 | 26 | int main(int argc, char *argv[]){ 27 | Solution s; 28 | cout << s.canConstruct("aab", "aaabbb") << endl; 29 | system("pause"); 30 | return 0; 31 | } -------------------------------------------------------------------------------- /Sort/RadixSort.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | int radixSort(int *a, int len){ 8 | int base = 10; 9 | int maxvalue = a[0]; 10 | for (int i = 1; i < len; ++i){ 11 | if (a[i] > maxvalue){ 12 | maxvalue = a[i]; 13 | } 14 | } 15 | vector> buckets(base); 16 | for (int i = 1; i <= maxvalue; i = i*base){ 17 | for (int j = 0; j < len; j++){ 18 | buckets[(a[j] / i) % base].push_back(a[j]); 19 | } 20 | int k = 0; 21 | for (int j = 0; j < base; j++){ 22 | for (auto num : buckets[j]){ 23 | a[k++] = num; 24 | } 25 | buckets[j].clear(); 26 | } 27 | } 28 | return 0; 29 | } -------------------------------------------------------------------------------- /141_LinkedListCycle/141_LinkedListCycle.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | struct ListNode { 6 | int val; 7 | ListNode *next; 8 | ListNode(int x) : val(x), next(NULL) {} 9 | }; 10 | 11 | class Solution { 12 | public: 13 | bool hasCycle(ListNode *head) { 14 | if (!head) return false; 15 | ListNode *fast = head, *slow = head; 16 | while (fast && fast->next){ 17 | fast = fast->next->next; 18 | slow = slow->next; 19 | if (fast == slow){ 20 | return true; 21 | } 22 | } 23 | return false; 24 | } 25 | }; 26 | 27 | int main(int argc, char *argv[]){ 28 | Solution s; 29 | cout << s.hasCycle(NULL) << endl; 30 | system("pause"); 31 | return 0; 32 | } -------------------------------------------------------------------------------- /392_IsSubsequence/392_IsSubsequence.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | bool isSubsequence(string s, string t) { 9 | const int n = s.size(); 10 | const int m = t.size(); 11 | if (n == 0){ 12 | return true; 13 | } 14 | if (m == 0){ 15 | return false; 16 | } 17 | int i = 0, j = -1; 18 | while (++j < m){ 19 | if (t[j] == s[i]){ 20 | if (i++ == n - 1){ 21 | return true; 22 | } 23 | } 24 | } 25 | return false; 26 | } 27 | }; 28 | 29 | int main(int argc, char *argv[]){ 30 | Solution s; 31 | cout << s.isSubsequence("abc", "ahbgdc") << endl; 32 | system("pause"); 33 | return 0; 34 | } -------------------------------------------------------------------------------- /122_MaxProfitII/122_MaxProfitII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int maxProfit(vector& prices) { 10 | const int n = prices.size(); 11 | if (n < 2){ 12 | return 0; 13 | } 14 | int curMin = prices[0]; 15 | int curMax = prices[0]; 16 | int res = 0; 17 | for (int i = 1; i < n; ++i){ 18 | int gain = prices[i] - prices[i - 1]; 19 | if (gain > 0){ 20 | res += gain; 21 | } 22 | } 23 | return res; 24 | } 25 | }; 26 | 27 | int main(int argc, char *argv[]){ 28 | Solution s; 29 | cout << s.maxProfit(vector{7, 1, 5, 3, 6, 4}); 30 | system("pause"); 31 | return 0; 32 | } -------------------------------------------------------------------------------- /242_ValidAnagram/242_ValidAnagram.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | bool isAnagram(string s, string t) { 10 | int count[26] = { 0 }; 11 | if (s.size() != t.size()){ 12 | return false; 13 | } 14 | for (auto c : t){ 15 | count[c - 'a']++; 16 | } 17 | for (auto c : s){ 18 | count[c - 'a']--; 19 | } 20 | for (int i = 0; i < 26; ++i){ 21 | if (count[i] != 0){ 22 | return false; 23 | } 24 | } 25 | return true; 26 | } 27 | }; 28 | 29 | int main(int argc, char *argv[]){ 30 | Solution s; 31 | cout << s.isAnagram("anagram", "nagaram") << endl; 32 | system("pause"); 33 | return 0; 34 | } -------------------------------------------------------------------------------- /206_ReverseLinkedList/206_ReverseLinkedList.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | struct ListNode { 6 | int val; 7 | ListNode *next; 8 | ListNode(int x) : val(x), next(NULL) {} 9 | }; 10 | 11 | class Solution { 12 | public: 13 | ListNode* reverseList(ListNode* head) { 14 | if (!head){ 15 | return NULL; 16 | } 17 | ListNode dummy(0); 18 | ListNode* hd = head; 19 | ListNode* nd = head->next; 20 | hd->next = NULL; 21 | while (nd){ 22 | auto t = nd->next; 23 | nd->next = hd; 24 | hd = nd; 25 | nd = t; 26 | } 27 | return hd; 28 | } 29 | }; 30 | 31 | int main(int argc, char *argv[]){ 32 | Solution s; 33 | s.reverseList(NULL); 34 | system("pause"); 35 | return 0; 36 | } -------------------------------------------------------------------------------- /309_MaxProfitCooldown/309_MaxProfitCooldown.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int maxProfit(vector& prices) { 10 | const int n = prices.size(); 11 | if (n < 2){ 12 | return 0; 13 | } 14 | int buy = INT_MIN, pre_buy = 0, sell = 0, pre_sell = 0; 15 | for (int price : prices){ 16 | pre_buy = buy; 17 | buy = max(pre_sell - price, pre_buy); 18 | pre_sell = sell; 19 | sell = max(pre_buy + price, pre_sell); 20 | } 21 | } 22 | }; 23 | 24 | int main(int argc, char *argv[]){ 25 | Solution s; 26 | cout << s.maxProfit(vector{1, 2, 3, 0, 2}); // 3 27 | system("pause"); 28 | return 0; 29 | } 30 | -------------------------------------------------------------------------------- /215_FindKthLargest/215_FindKthLargest.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | class Solution { 9 | public: 10 | int findKthLargest(vector& nums, int k) { 11 | if (nums.empty()){ 12 | return 0; 13 | } 14 | priority_queue, greater> pq; 15 | for (auto num : nums){ 16 | if (pq.size() < k || num > pq.top()){ 17 | pq.push(num); 18 | } 19 | if (pq.size() > k){ 20 | pq.pop(); 21 | } 22 | } 23 | return pq.top(); 24 | } 25 | }; 26 | 27 | int main(int argc, char *argv[]){ 28 | Solution s; 29 | cout << s.findKthLargest(vector{2, 1}, 2) << endl; 30 | system("pause"); 31 | return 0; 32 | } -------------------------------------------------------------------------------- /094_InorderTraversal/094_InorderTraversal.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | struct TreeNode { 7 | int val; 8 | TreeNode *left; 9 | TreeNode *right; 10 | TreeNode(int x) : val(x), left(NULL), right(NULL) {} 11 | }; 12 | 13 | class Solution { 14 | public: 15 | vector inorderTraversal(TreeNode* root) { 16 | inorder(root); 17 | return res; 18 | } 19 | private: 20 | void inorder(TreeNode* root){ 21 | if (root == NULL){ 22 | return; 23 | } 24 | inorder(root->left); 25 | res.push_back(root->val); 26 | inorder(root->right); 27 | } 28 | vector res; 29 | }; 30 | 31 | int main(int argc, char *argv){ 32 | Solution s; 33 | system("pause"); 34 | return 0; 35 | } -------------------------------------------------------------------------------- /120_MinSumTriangle/120_MinSumTriangle.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int minimumTotal(vector>& triangle) { 10 | const int n = triangle.size(); 11 | if (n == 0){ 12 | return 0; 13 | } 14 | for (int i = n - 2; i >= 0; --i){ 15 | for (int j = 0; j <= i; ++j){ 16 | triangle[i][j] += min(triangle[i + 1][j], triangle[i + 1][j + 1]); 17 | } 18 | } 19 | return triangle[0][0]; 20 | } 21 | }; 22 | 23 | int main(int argc, char *argv[]){ 24 | Solution s; 25 | cout << s.minimumTotal(vector>{{2}, { 3, 4 }, { 6, 5, 7 }, { 4, 1, 8, 3 }}) << endl; // 11 26 | system("pause"); 27 | return 0; 28 | } -------------------------------------------------------------------------------- /134_GasStation/134_GasStation.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int canCompleteCircuit(vector& gas, vector& cost) { 9 | const int n = gas.size(); 10 | int cum = 0, min = INT_MAX, minid = -1; 11 | for (int i = 0; i < n; ++i){ 12 | int tmp = gas[i] - cost[i]; 13 | cum += tmp; 14 | if (cum < min){ 15 | min = cum; 16 | minid = i + 1; 17 | } 18 | } 19 | if (minid == n){ 20 | minid = 0; 21 | } 22 | return (cum < 0) ? -1 : minid; 23 | } 24 | }; 25 | 26 | int main(int argc, char *argv[]){ 27 | Solution s; 28 | cout << s.canCompleteCircuit(vector{4}, vector{5}) << endl; 29 | system("pause"); 30 | return 0; 31 | } -------------------------------------------------------------------------------- /386_LexicalOrder/386_LexicalOrder.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | vector lexicalOrder(int n) { 9 | vector res(n); 10 | int cur = 1; 11 | for (int i = 0; i < n; ++i){ 12 | res[i] = cur; 13 | if (cur * 10 <= n){ 14 | cur *= 10; 15 | } else{ 16 | if (cur >= n){ 17 | cur /= 10; 18 | } 19 | cur += 1; 20 | while (cur % 10 == 0) { 21 | cur /= 10; 22 | } 23 | } 24 | } 25 | return res; 26 | } 27 | }; 28 | 29 | int main(int argc, char *argv[]){ 30 | Solution s; 31 | auto vs = s.lexicalOrder(13); 32 | for (auto v : vs){ 33 | cout << v << ", "; 34 | } 35 | system("pause"); 36 | return 0; 37 | } -------------------------------------------------------------------------------- /268_MissingNumber/268_MissingNumber.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int missingNumber(vector& nums) { 9 | int i = 0; 10 | int res = 0; 11 | while (i < nums.size()) { 12 | res ^= nums[i]; 13 | res ^= i; 14 | i++; 15 | } 16 | return res^i; 17 | } 18 | 19 | int missingNumberMy(vector& nums) { 20 | const int n = nums.size(); 21 | long long sum = 0; 22 | for (auto& num : nums){ 23 | sum += num; 24 | } 25 | return ((1 + n) * (long long)n) / 2 - sum; 26 | } 27 | }; 28 | 29 | int main(int argc, char *argv[]){ 30 | Solution s; 31 | cout << s.missingNumber(vector{0, 1, 3}) << endl; 32 | system("pause"); 33 | return 0; 34 | } -------------------------------------------------------------------------------- /139_WordBreak/139_WordBreak.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | bool wordBreak(string s, vector& wordDict) { 10 | const int n = s.size(); 11 | vector dp(n+1, false); 12 | dp[0] = true; 13 | for (int i = 1; i <= n; ++i){ 14 | for (int j = i - 1; j >= 0; --j){ 15 | if (dp[j] && (find(wordDict.begin(), wordDict.end(), s.substr(j, i - j)) != wordDict.end())){ 16 | dp[i] = true; 17 | break; 18 | } 19 | } 20 | } 21 | return dp[n]; 22 | } 23 | }; 24 | 25 | int main(int argc, char *argv[]){ 26 | Solution s; 27 | cout << s.wordBreak("leetcode", vector{"leet" , "code"}) << endl; 28 | system("pause"); 29 | return 0; 30 | } -------------------------------------------------------------------------------- /202_HappyNumber/202_HappyNumber.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | bool isHappy(int n) { 10 | if (n <= 0){ 11 | return false; 12 | } 13 | unordered_set hash; 14 | 15 | while (n != 1){ 16 | hash.insert(n); 17 | int sum = 0; 18 | while (n > 0) { 19 | int tmp = n / 10; 20 | int t = n - 10 * tmp; 21 | sum += t*t; 22 | n = tmp; 23 | } 24 | n = sum; 25 | if (hash.find(n) != hash.end()){ 26 | return false; 27 | } 28 | } 29 | return true; 30 | } 31 | }; 32 | 33 | int main(int argc, char *argv[]){ 34 | Solution s; 35 | cout << s.isHappy(19) << endl; 36 | system("pause"); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /396_RotateFunction/396_RotateFunction.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int maxRotateFunction(vector& A) { 10 | const int n = A.size(); 11 | if (n == 0){ 12 | return 0; 13 | } 14 | long long sum = 0, fval = 0, fmax = 0; 15 | for (int i = 0; i < n; ++i){ 16 | sum += A[i]; 17 | fval += i * A[i]; 18 | } 19 | fmax = fval; 20 | for (int i = n-1; i > 0; --i){ 21 | fval += sum; 22 | fval -= n*A[i]; 23 | fmax = max(fmax, fval); 24 | } 25 | return fmax; 26 | } 27 | }; 28 | 29 | int main(int argc, char *argv[]){ 30 | Solution s; 31 | cout << s.maxRotateFunction(vector{4, 3, 2, 6}) << endl; 32 | system("pause"); 33 | return 0; 34 | } -------------------------------------------------------------------------------- /219_ContainsDuplicateII/219_ContainsDuplicateII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | bool containsNearbyDuplicate(vector& nums, int k) { 10 | const int n = nums.size(); 11 | unordered_map table; 12 | for (int i = 0; i < n; ++i){ 13 | if (table.find(nums[i]) == table.end()){ 14 | table[nums[i]] = i; 15 | } else{ 16 | if (i - table[nums[i]] <= k){ 17 | return true; 18 | } 19 | table[nums[i]] = i; 20 | } 21 | } 22 | return false; 23 | } 24 | }; 25 | 26 | int main(int argc, char *argv[]){ 27 | Solution s; 28 | cout << s.containsNearbyDuplicate(vector{3, 1, 5, 2, 1}, 2) << endl; 29 | system("pause"); 30 | return 0; 31 | } -------------------------------------------------------------------------------- /075_SortColors/075_SortColors.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | void sortColors(vector& nums) { 9 | const int n = nums.size(); 10 | int i = 0, j = 0, k = n-1; 11 | while (j <= k){ 12 | switch (nums[j]){ 13 | case 0: 14 | swap(nums[i++], nums[j++]); 15 | break; 16 | case 1: 17 | j++; 18 | break; 19 | case 2: 20 | swap(nums[j], nums[k--]); 21 | break; 22 | default: 23 | break; 24 | } 25 | } 26 | return; 27 | } 28 | }; 29 | 30 | int main(int argc, char *argv[]){ 31 | Solution s; 32 | vector v{ 0, 1, 2, 2, 1, 0 }; 33 | s.sortColors(v); 34 | for (auto vv : v){ 35 | cout << vv << ", "; 36 | } 37 | system("pause"); 38 | return 0; 39 | } -------------------------------------------------------------------------------- /007_ReverseInteger/007_ReverseInteger.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int reverse(int x) { 9 | int sign = 1; 10 | long long xx = x; 11 | if (x == 0){ 12 | return x; 13 | } else if (x < 0){ 14 | sign = -1; 15 | xx = -xx; 16 | } 17 | long long y = 0, z = xx; 18 | int t1 = INT_MAX / 10, t2 = INT_MAX % 10; 19 | while (z){ 20 | y = 10 * y + z % 10; 21 | z /= 10; 22 | if (z > 0 && y >= t1){ 23 | if (y == t1 && z <= t2){ 24 | continue; 25 | } 26 | return 0; 27 | } 28 | } 29 | return sign == 1 ? y : -y; 30 | } 31 | }; 32 | 33 | int main(int argc, char *argv[]){ 34 | Solution s; 35 | cout << s.reverse(-2147483648) << endl; 36 | system("pause"); 37 | return 0; 38 | } -------------------------------------------------------------------------------- /077_Combinations/077_Combinations.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | vector> combine(int n, int k) { 9 | dfs(0, n, k); 10 | return res; 11 | } 12 | 13 | private: 14 | void dfs(int start, int n, int depth){ 15 | if (!depth){ 16 | res.push_back(ans); 17 | } 18 | for (int i = start+1; i <= n; ++i){ 19 | ans.push_back(i); 20 | dfs(i, n, depth-1); 21 | ans.pop_back(); 22 | } 23 | } 24 | vector ans; 25 | vector> res; 26 | }; 27 | 28 | int main(int argc, char *argv[]){ 29 | Solution s; 30 | auto res = s.combine(4, 2); 31 | for (auto vv : res){ 32 | for (auto v : vv){ 33 | cout << v << ", "; 34 | } 35 | cout << endl; 36 | } 37 | system("pause"); 38 | return 0; 39 | } -------------------------------------------------------------------------------- /259_ThreeSumSmaller/259_ThreeSumSmaller.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int threeSumSmaller(vector& nums, int target) { 10 | const int n = nums.size(); 11 | sort(nums.begin(), nums.end()); 12 | int cnt = 0; 13 | for (int i = 0; i < n - 2; ++i){ 14 | int j = i + 1, k = n - 1, tar = target - nums[i]; 15 | while (j < k) { 16 | int t = nums[j] + nums[k]; 17 | if (t < tar){ 18 | cnt += k - (j++); 19 | j++; 20 | } else { 21 | k--; 22 | } 23 | } 24 | } 25 | return cnt; 26 | } 27 | }; 28 | 29 | int main(int argc, char *argv[]){ 30 | Solution s; 31 | cout << s.threeSumSmaller(vector{-2, 1, 1}, 1) << endl; 32 | system("pause"); 33 | return 0; 34 | } -------------------------------------------------------------------------------- /303_RangeSumQueryI/303_RangeSumQueryI.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class NumArray { 7 | public: 8 | NumArray(vector nums) { 9 | const int n = nums.size(); 10 | intel.resize(n); 11 | if (n == 0){ 12 | return; 13 | } 14 | intel[0] = nums[0]; 15 | for (int i = 1; i < n; ++i){ 16 | intel[i] = intel[i - 1] + nums[i]; 17 | } 18 | return; 19 | } 20 | 21 | int sumRange(int i, int j) { 22 | if (i == 0){ 23 | return intel[j]; 24 | } 25 | if (j == 0){ 26 | return 0; 27 | } 28 | return intel[j] - intel[i - 1]; 29 | } 30 | private: 31 | vector intel; 32 | }; 33 | 34 | int main(int argc, char *argv[]){ 35 | NumArray obj(vector{1, 2, 3}); 36 | cout << obj.sumRange(1, 2) << endl; 37 | system("pause"); 38 | return 0; 39 | } -------------------------------------------------------------------------------- /169_MajorityElement/169_MajorityElement.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int majorityElement(vector& nums) { 10 | const int n = nums.size(); 11 | unordered_map hash; 12 | for (int i = 0; i < n; ++i){ 13 | if (hash.find(nums[i]) == hash.end()){ 14 | hash.insert({ nums[i], 0 }); 15 | } else{ 16 | hash[nums[i]]++; 17 | } 18 | } 19 | int cnt = 0, val = nums[0]; 20 | for (auto& m : hash){ 21 | if (m.second > cnt){ 22 | cnt = m.second; 23 | val = m.first; 24 | } 25 | } 26 | return val; 27 | } 28 | }; 29 | 30 | int main(int argc, char *argv[]){ 31 | Solution s; 32 | cout << s.majorityElement(vector{}) << endl; 33 | system("pause"); 34 | return 0; 35 | } -------------------------------------------------------------------------------- /022_GenerateParentheses/022_GenerateParentheses.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | vector generateParenthesis(int n) { 10 | if (n < 1){ 11 | return{}; 12 | } 13 | dfs(string(""), n, n); 14 | return res; 15 | } 16 | 17 | private: 18 | void dfs(string s, int l, int r){ 19 | if (l == 0 && r == 0){ 20 | res.push_back(s); 21 | return; 22 | } 23 | if (l > 0){ 24 | dfs(s + "(", l-1, r); 25 | } 26 | if (r > l){ 27 | dfs(s + ")", l, r-1); 28 | } 29 | } 30 | vector res; 31 | }; 32 | 33 | int main(int argc, char *argv[]){ 34 | Solution s; 35 | auto vs = s.generateParenthesis(3); 36 | for (auto s : vs){ 37 | cout << s << endl; 38 | } 39 | system("pause"); 40 | return 0; 41 | } -------------------------------------------------------------------------------- /220_ContainsDuplicateIII/220_ContainsDuplicateIII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | class Solution { 9 | public: 10 | bool containsNearbyAlmostDuplicate(vector& nums, int k, int t) { 11 | map m; 12 | int j = 0; 13 | for (int i = 0; i < nums.size(); ++i){ 14 | if (i - j > k){ 15 | m.erase(nums[j++]); 16 | } 17 | auto a = m.lower_bound((long long)nums[i] - t); 18 | if (a != m.end() && abs(a->first - nums[i]) <= t){ 19 | return true; 20 | } 21 | m[nums[i]] = i; 22 | } 23 | return false; 24 | } 25 | }; 26 | 27 | int main(int argc, char *argv[]){ 28 | Solution s; 29 | cout << s.containsNearbyAlmostDuplicate(vector{1, 2, 3, 4}, 3, 2) << endl; 30 | system("pause"); 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /001_TwoSum/001_TwoSum.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | // 给定一个数组 nums ,和一个目标值target 10 | // 返回 数组中 和 为 target 的两个索引 11 | vector twoSum(vector& nums, int target) { 12 | hash_map m; // unordered_map 无序map 差值元素 o(1) 13 | for (int i = 0; i < nums.size(); ++i){ 14 | if (m.count(target - nums[i]))// 差值 目标差值是否存在 15 | { 16 | return{m[target - nums[i]], i};//找到返回 两个元素的 索引 17 | } 18 | m[nums[i]] = i;// 插入map记录 值,index 19 | } 20 | return{}; 21 | } 22 | }; 23 | 24 | int main(int argc, char *argv[]){ 25 | Solution s; 26 | auto v = s.twoSum(vector{2, 7, 11, 15}, 9); 27 | if (v.size() == 2){ 28 | cout << v[0] << ", " << v[1] << endl; 29 | } 30 | system("pause"); 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /035_InsertPosition/035_InsertPosition.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int searchInsert(vector& nums, int target) { 9 | const int n = nums.size(); 10 | int l = 0, r = n - 1; 11 | while (l <= r) { 12 | if (target <= nums[l]){ 13 | return l; 14 | } 15 | if (target == nums[r]){ 16 | return r; 17 | } 18 | if (target > nums[r]){ 19 | return r + 1; 20 | } 21 | int m = (l + r) / 2; 22 | if (target < nums[m]){ 23 | r = m - 1; 24 | } else if(target > nums[m]){ 25 | l = m + 1; 26 | } else{ 27 | return m; 28 | } 29 | } 30 | return 0; 31 | } 32 | }; 33 | 34 | int main(int argc, char *argv[]){ 35 | Solution s; 36 | cout << s.searchInsert(vector{1, 3}, 2) << endl; 37 | system("pause"); 38 | return 0; 39 | } -------------------------------------------------------------------------------- /078_Subsets/078_Subsets.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | vector> subsets(vector& nums) { 9 | n = nums.size(); 10 | vector ans; 11 | dfs(-1, nums, ans); 12 | return res; 13 | } 14 | private: 15 | void dfs(int start, vector& nums, vector& ans){ 16 | res.push_back(ans); 17 | for (int i = start + 1; i < n; ++i){ 18 | ans.push_back(nums[i]); 19 | dfs(i, nums, ans); 20 | ans.pop_back(); 21 | } 22 | } 23 | vector> res; 24 | int n; 25 | }; 26 | 27 | int main(int argc, char *argv[]){ 28 | Solution s; 29 | auto matrix = s.subsets(vector{1, 4, 9}); 30 | for (auto mat : matrix){ 31 | for (auto m : mat){ 32 | cout << m << ", "; 33 | } 34 | cout << endl; 35 | } 36 | system("pause"); 37 | return 0; 38 | } -------------------------------------------------------------------------------- /136_SingleNumber/136_SingleNumber.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int singleNumber(vector& nums) { 10 | if (!nums.size()) return 0; 11 | int res = nums[0]; 12 | for (int i = 1; i& nums) { 19 | unordered_set st; 20 | long long sum = 0; 21 | for (auto num : nums){ 22 | if (st.count(num) == 1){ 23 | st.erase(num); 24 | sum -= num; 25 | } else{ 26 | st.insert(num); 27 | sum += num; 28 | } 29 | } 30 | return (int)sum; 31 | } 32 | }; 33 | 34 | int main(int argc, char *argv[]){ 35 | Solution s; 36 | cout << s.singleNumber(vector{1, 1, 2, 3, 2}) << endl; 37 | system("pause"); 38 | return 0; 39 | } -------------------------------------------------------------------------------- /243_ShortestDistance/243_ShortestDistance.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | class Solution { 9 | public: 10 | int shortestDistance(vector& words, string word1, string word2) { 11 | const int n = words.size(); 12 | int prev1 = -n, prev2 = -n, distance = n; 13 | for (int i = 0; i < n; ++i){ 14 | if (words[i] == word1){ 15 | distance = min(distance, i - prev2); 16 | prev1 = i; 17 | } else if (words[i] == word2){ 18 | distance = min(distance, i - prev1); 19 | prev2 = i; 20 | } 21 | } 22 | return distance; 23 | } 24 | }; 25 | 26 | int main(int argc, char *argv[]){ 27 | Solution s; 28 | cout << s.shortestDistance(vector{"practice", "makes", "perfect", "coding", "makes"}, "coding", "practice") << endl; 29 | system("pause"); 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /OnlineJudge/OnlineJudge.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | -------------------------------------------------------------------------------- /104_MaxDepth/104_MaxDepth.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | struct TreeNode { 6 | int val; 7 | TreeNode *left; 8 | TreeNode *right; 9 | TreeNode(int x) : val(x), left(NULL), right(NULL) {} 10 | }; 11 | 12 | class Solution { 13 | public: 14 | int maxDepth(TreeNode* root) { 15 | maxdepth = 0; 16 | if (root){ 17 | dfs(root, 1); 18 | } 19 | return maxdepth; 20 | } 21 | private: 22 | void dfs(TreeNode* node, int depth){ 23 | if (node->left){ 24 | dfs(node->left, depth+1); 25 | } 26 | if (node->right){ 27 | dfs(node->right, depth+1); 28 | } 29 | if (!node->left && !node->right){ 30 | if (depth > maxdepth){ 31 | maxdepth = depth; 32 | } 33 | } 34 | } 35 | int maxdepth; 36 | }; 37 | 38 | int main(int argc, char *argv[]){ 39 | Solution s; 40 | cout << s.maxDepth(NULL) << endl; 41 | system("pause"); 42 | return 0; 43 | } -------------------------------------------------------------------------------- /050_Pow/050_Pow.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Solution { 6 | public: 7 | double myPow(double x, int n) { 8 | if (n == 0){ 9 | return 1; 10 | } 11 | bool sign = true; 12 | if (n < 0){ 13 | n = -n; 14 | sign = false; 15 | } 16 | if (x > 1.9 && n == INT_MIN){ 17 | return 0; 18 | } 19 | double tmp[31]; 20 | tmp[0] = x; 21 | int i = 1; 22 | double res = (n & i) ? x : 1; 23 | for (; i < 31; ++i){ 24 | tmp[i] = tmp[i - 1] * tmp[i - 1]; 25 | double t = (n & (1 << i)) ? tmp[i] : 1; 26 | res *= t; 27 | if ((1 << i) > n){ 28 | break; 29 | } 30 | } 31 | if (!sign){ 32 | res = 1 / res; 33 | } 34 | return res; 35 | } 36 | }; 37 | 38 | int main(int argc, char *argv[]){ 39 | Solution s; 40 | cout << INT_MIN << endl; 41 | cout << s.myPow(2, INT_MIN) << endl; 42 | system("pause"); 43 | return 0; 44 | } -------------------------------------------------------------------------------- /152_MaxProduct/152_MaxProduct.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int maxProduct(vector& nums) { 10 | const int n = nums.size(); 11 | if (n == 0){ 12 | return 0; 13 | } 14 | int curMin = nums[n - 1]; 15 | int curMax = nums[n - 1]; 16 | int maxpro = nums[n - 1]; 17 | for (int i = n-2; i >= 0; --i){ 18 | int n1 = nums[i] * curMin; 19 | int n2 = nums[i] * curMax; 20 | if (n1 > n2){ 21 | swap(n1, n2); 22 | } 23 | curMin = min(nums[i], n1); 24 | curMax = max(nums[i], n2); 25 | if (curMax > maxpro){ 26 | maxpro = curMax; 27 | } 28 | } 29 | return maxpro; 30 | } 31 | }; 32 | 33 | int main(int argc, char *argv[]){ 34 | Solution s; 35 | cout << s.maxProduct(vector{2, 3, -2, 4}) << endl; 36 | system("pause"); 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /029_DivideTwoIntegers/029_DivideTwoIntegers.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | -------------------------------------------------------------------------------- /084_LargestRectangleArea/084_LargestRectangleArea.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | class Solution { 9 | public: 10 | int largestRectangleArea(vector& heights) { 11 | int res = 0; 12 | heights.push_back(0); // NIL 13 | stack si; 14 | const int n = heights.size(); 15 | for (int i = 0; i < n; ++i){ 16 | while (!si.empty() && heights[i] <= heights[si.top()]) { 17 | int h = heights[si.top()]; 18 | si.pop(); 19 | int area = h * (si.empty() ? i : (i-si.top()-1)); 20 | res = max(res, area); 21 | } 22 | si.push(i); 23 | } 24 | return res; 25 | } 26 | }; 27 | 28 | int main(int argc, char *argv[]){ 29 | Solution s; 30 | cout << s.largestRectangleArea(vector{3, 5, 5, 2, 5, 5, 6, 6, 4, 4, 1, 1, 2, 5, 5, 6, 6, 4, 1, 3}) << endl; // 24 31 | system("pause"); 32 | return 0; 33 | } -------------------------------------------------------------------------------- /394_DecodeString/394_DecodeString.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | string decodeString(string s) { 10 | int k = 0; 11 | return dfs(s, k); 12 | } 13 | private: 14 | string dfs(string s, int &k){ 15 | string ans; 16 | int cnt = 0; 17 | while (k < s.size()){ 18 | if (isdigit(s[k])){ 19 | cnt = cnt * 10 + (s[k++]-'0'); 20 | } else if (s[k] == '['){ 21 | string tem = dfs(s, ++k); 22 | for (int i = 0; i < cnt; ++i){ 23 | ans += tem; 24 | } 25 | cnt = 0; 26 | } else if (s[k] == ']'){ 27 | k++; 28 | return ans; 29 | } else{ 30 | ans += s[k++]; 31 | } 32 | } 33 | return ans; 34 | } 35 | }; 36 | 37 | int main(int argc, char *argv[]){ 38 | Solution s; 39 | cout << s.decodeString("3[a]2[bc]") << endl; 40 | system("pause"); 41 | return 0; 42 | } -------------------------------------------------------------------------------- /115_DistinctSubsequences/115_DistinctSubseqences.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | class Solution { 9 | public: 10 | int numDistinct(string s, string t) { 11 | const int m = s.size(); 12 | const int n = t.size(); 13 | 14 | vector> dp(m+1, vector(n+1)); 15 | dp[0][0] = 1; 16 | for (int i = 1; i <= m; ++i){ 17 | dp[i][0] = 1; 18 | } 19 | for (int i = 1; i <= m; ++i){ 20 | int bd = min(i, n); 21 | for (int j = 1; j <= bd; ++j){ 22 | if (s[i - 1] == t[j - 1]){ 23 | dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j]; 24 | } else{ 25 | dp[i][j] = dp[i - 1][j]; 26 | } 27 | } 28 | } 29 | return dp[m][n]; 30 | } 31 | }; 32 | 33 | int main(int argc, char *argv[]){ 34 | Solution s; 35 | cout << s.numDistinct("a", "a") << endl; 36 | system("pause"); 37 | return 0; 38 | } -------------------------------------------------------------------------------- /080_RemoveDuplicatesII/080_RemoveDuplicatesII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int removeDuplicates(vector& nums) { 9 | const int n = nums.size(); 10 | if (n < 3){ 11 | return n; 12 | } 13 | int cnt = 1, len = 1; 14 | int cur = nums[0]; 15 | for (int i = 1; i < n; ++i){ 16 | if (nums[i] == cur){ 17 | if (cnt == 1){ 18 | nums[len] = nums[i]; 19 | len++; 20 | cnt++; 21 | } 22 | } else{ 23 | cnt = 1; 24 | cur = nums[i]; 25 | nums[len] = nums[i]; 26 | len++; 27 | } 28 | } 29 | return len; 30 | } 31 | }; 32 | 33 | int main(int argc, char *argv[]){ 34 | Solution s; 35 | vector nums{ 1, 1, 1, 2, 2, 3 }; 36 | int n = s.removeDuplicates(nums); 37 | for (int i = 0; i < n; ++i){ 38 | cout << nums[i] << ", "; 39 | } 40 | system("pause"); 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /006_ZigZagConversion/006_ZigZagConversion.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | string convert(string s, int numRows) { 10 | const int n = s.size(); 11 | if (n < 3 || numRows == 1){ 12 | return s; 13 | } 14 | vector ss(numRows); 15 | int r = 0; 16 | int m = numRows / 2; 17 | int isdown = 1; // will go to the mid 18 | for (int i = 0; i < n; ++i){ 19 | ss[r] = ss[r] + s[i]; 20 | r += isdown; 21 | if (r >= numRows){ 22 | r -= 2; 23 | isdown = -1; 24 | } 25 | if (r < 0){ 26 | r += 2; 27 | isdown = 1; 28 | } 29 | } 30 | string res; 31 | for (auto sr : ss){ 32 | res += sr; 33 | } 34 | return res; 35 | } 36 | }; 37 | 38 | int main(int argc, char *argv[]){ 39 | Solution s; 40 | cout << s.convert("ABC", 2) << endl; 41 | system("pause"); 42 | return 0; 43 | } -------------------------------------------------------------------------------- /011_MaxArea/011_MaxArea.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int maxArea(vector& height) { 10 | int i = 0, j = height.size() - 1; 11 | int area = min(height[i], height[j]) * (j - i); 12 | int len = j; 13 | while (i != j){ 14 | len--; 15 | if (height[i] < height[j]){ 16 | i++; 17 | if (height[i] <= height[i - 1]){ 18 | continue; 19 | } else{ 20 | area = max(area, min(height[i], height[j]) * len); 21 | } 22 | } else{ 23 | j--; 24 | if (height[j] <= height[j + 1]){ 25 | continue; 26 | } else{ 27 | area = max(area, min(height[i], height[j]) * len); 28 | } 29 | } 30 | } 31 | 32 | return area; 33 | } 34 | }; 35 | 36 | int main(int argc, char *argv[]){ 37 | Solution s; 38 | cout << s.maxArea(vector{2,3,10,5,7,8,9}) << endl; 39 | system("pause"); 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /088_MergeSortedArray/088_MergeSortedArray.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | void merge(vector& nums1, int m, vector& nums2, int n) { 9 | if (m == 0){ 10 | nums1 = nums2; 11 | return; 12 | } 13 | if (n == 0){ 14 | return; 15 | } 16 | nums1.resize(m + n); 17 | int i = m - 1, j = n - 1, k = m + n - 1; 18 | while (k >= 0) 19 | { 20 | if (i >= 0 && nums1[i] >= nums2[j]){ 21 | nums1[k--] = nums1[i--]; 22 | } else{ 23 | nums1[k--] = nums2[j--]; 24 | } 25 | if (j < 0){ 26 | break; 27 | } 28 | } 29 | return; 30 | } 31 | }; 32 | 33 | int main(int argc, char *argv[]){ 34 | Solution s; 35 | vector nums1{ 1, 2, 3, 5 }; 36 | vector nums2{ 4, 6, 7, 9 }; 37 | s.merge(nums1, nums1.size(), nums2, nums2.size()); 38 | for (auto v : nums1){ 39 | cout << v << ", "; 40 | } 41 | system("pause"); 42 | return 0; 43 | } -------------------------------------------------------------------------------- /161_OneEditDistance/161_OneEditDistance.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | bool isOneEditDistance(string s, string t) { 10 | const int m = s.size(); 11 | const int n = t.size(); 12 | if (abs(m - n) > 1){ 13 | return false; 14 | } 15 | if (m == 0 || n == 0){ 16 | return m || n; 17 | } 18 | int distance = 0; 19 | int i = 0, j = 0; 20 | while (i < m && j < n){ 21 | if (s[i++] != t[j++]){ 22 | if (++distance > 1){ 23 | return false; 24 | } 25 | if (m > n){ 26 | j--; 27 | } 28 | if (m < n){ 29 | i--; 30 | } 31 | } 32 | } 33 | if (i == m && j == n){ 34 | return distance == 1; 35 | } 36 | return distance == 0; 37 | } 38 | }; 39 | 40 | int main(int argc, char *argv[]){ 41 | Solution s; 42 | cout << s.isOneEditDistance("a", "ac") << endl; 43 | system("pause"); 44 | return 0; 45 | } -------------------------------------------------------------------------------- /240_SearchMatrixII/240_SearchMatrixII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | bool searchMatrix(vector>& matrix, int target) { 9 | int m = matrix.size(); 10 | if (!m){ 11 | return false; 12 | } 13 | int n = matrix[0].size(); 14 | if (!n){ 15 | return false; 16 | } 17 | int i = 0, j = n - 1; 18 | while (i < m && j >= 0) { 19 | if (matrix[i][j] == target){ 20 | return true; 21 | } else if (matrix[i][j] > target){ 22 | --j; 23 | } else{ 24 | ++i; 25 | } 26 | } 27 | return false; 28 | } 29 | }; 30 | 31 | int main(int argc, char *argv[]){ 32 | Solution s; 33 | vector> matrix{ 34 | { 1, 4, 7, 11, 15 }, 35 | { 2, 5, 8, 12, 19 }, 36 | { 3, 6, 9, 16, 22 }, 37 | { 10, 13, 14, 17, 24 }, 38 | { 18, 21, 23, 26, 30 } }; 39 | cout << s.searchMatrix(matrix, 5) << endl; 40 | system("pause"); 41 | return 0; 42 | } -------------------------------------------------------------------------------- /031_NextPermutation/031_NextPermutation.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | void nextPermutation(vector& nums) { 10 | const int n = nums.size(); 11 | int minid = 0; 12 | for (int i = n - 2; i >= 0; --i){ 13 | int curmin = INT_MAX; 14 | for (int j = i + 1; j < n; ++j){ 15 | int tmp = nums[j] - nums[i]; 16 | if (tmp > 0){ 17 | curmin = min(curmin, tmp); 18 | minid = j; 19 | } 20 | } 21 | if (curmin < INT_MAX){ 22 | swap(nums[i], nums[minid]); 23 | minid = i + 1; 24 | break; 25 | } 26 | } 27 | sort(nums.begin() + minid, nums.end()); 28 | return; 29 | } 30 | }; 31 | 32 | int main(int argc, char *argv[]){ 33 | Solution s; 34 | vector vec{ 23, 16, 1, 20 }; 35 | s.nextPermutation(vec); 36 | for (auto v : vec){ 37 | cout << v << ", "; 38 | } 39 | system("pause"); 40 | return 0; 41 | } 42 | -------------------------------------------------------------------------------- /170_TwoSumIII/170_TwoSumIII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class TwoSum { 8 | public: 9 | /** Initialize your data structure here. */ 10 | TwoSum() {} 11 | 12 | /** Add the number to an internal data structure.. */ 13 | void add(int number) { 14 | hash[number]++; 15 | } 16 | 17 | /** Find if there exists any pair of numbers which sum is equal to the value. */ 18 | bool find(int value) { 19 | for (auto val : hash){ 20 | if (value != 2 * val.first && hash.count(value - val.first)){ 21 | return true; 22 | } 23 | if (value == 2 * val.first && val.second > 1){ 24 | return true; 25 | } 26 | } 27 | return false; 28 | } 29 | 30 | private: 31 | unordered_map hash; 32 | }; 33 | 34 | int main(int argc, char *argv[]){ 35 | TwoSum obj; 36 | obj.add(2); 37 | obj.add(3); 38 | cout << obj.find(5) << endl; 39 | system("pause"); 40 | return 0; 41 | } -------------------------------------------------------------------------------- /155_MinStack/155_MinStack.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class MinStack { 7 | public: 8 | /** initialize your data structure here. */ 9 | MinStack() {} 10 | 11 | void push(int x) { 12 | s1.push(x); 13 | if (s2.empty() || s2.top() >= x){ 14 | s2.push(x); 15 | } 16 | } 17 | 18 | void pop() { 19 | if (s2.top() == s1.top()){ 20 | s2.pop(); 21 | } 22 | s1.pop(); 23 | } 24 | 25 | int top() { 26 | return s1.top(); 27 | } 28 | 29 | int getMin() { 30 | return s2.top(); 31 | } 32 | 33 | private: 34 | stack s1, s2; 35 | }; 36 | 37 | int main(int argc, char *argv[]){ 38 | MinStack obj; 39 | obj.push(-3); 40 | obj.push(0); 41 | obj.push(-4); 42 | obj.push(-4); 43 | cout << obj.getMin() << endl; // -3 44 | obj.pop(); 45 | obj.pop(); 46 | obj.pop(); 47 | cout << obj.top() << endl; // 0 48 | cout << obj.getMin() << endl; // -2 49 | system("pause"); 50 | return 0; 51 | } -------------------------------------------------------------------------------- /213_HouseRobberII/213_HouseRobberII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int rob(vector& nums) { 10 | const int n = nums.size(); 11 | if (n == 0){ 12 | return 0; 13 | } 14 | if (n == 1){ 15 | return nums[0]; 16 | } 17 | 18 | int cur = nums[0]; 19 | int prev = nums[0]; 20 | int pprev = 0; 21 | for (int i = 1; i < n - 1; ++i){ 22 | cur = max(prev, pprev + nums[i]); 23 | pprev = prev; 24 | prev = cur; 25 | } 26 | 27 | int cur2 = nums[1]; 28 | prev = nums[1]; 29 | pprev = 0; 30 | for (int i = 2; i < n; ++i){ 31 | cur2 = max(prev, pprev + nums[i]); 32 | pprev = prev; 33 | prev = cur2; 34 | } 35 | 36 | return max(cur, cur2); 37 | } 38 | }; 39 | 40 | int main(int argc, char *argv[]){ 41 | Solution s; 42 | cout << s.rob(vector{2, 7, 9, 3, 1}) << endl; 43 | system("pause"); 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /042_TrappingRainWater/042_TrappingRainWater.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int trap(vector& height) { 10 | if (height.size() < 2){ 11 | return 0; 12 | } 13 | int vol = 0; 14 | int i = 0, j = height.size() - 1; 15 | int mh = min(height[i], height[j]); 16 | while (i < j){ 17 | if (height[i] < height[j]){ 18 | i++; 19 | if (height[i] > mh){ 20 | mh = min(height[i], height[j]); 21 | } else{ 22 | vol += (mh - height[i]); 23 | } 24 | } else{ 25 | j--; 26 | if (height[j] > mh){ 27 | mh = min(height[i], height[j]); 28 | } else{ 29 | vol += (mh - height[j]); 30 | } 31 | } 32 | } 33 | return vol; 34 | } 35 | }; 36 | 37 | int main(int argc, char *argv[]){ 38 | Solution s; 39 | cout << s.trap(vector{0, 1, 0, 2, 1, 0, 1, 3, 2, 1, 2, 1}) << endl; 40 | system("pause"); 41 | return 0; 42 | } -------------------------------------------------------------------------------- /216_CombinationSumIII/216_CombinationSumIII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | vector> combinationSum3(int k, int n) { 9 | dpth = k; 10 | dfs(0, n, 0); 11 | return res; 12 | } 13 | private: 14 | void dfs(int start, int target, int deepth){ 15 | if (deepth == dpth && target == 0){ 16 | res.push_back(ans); 17 | return; 18 | } 19 | if (deepth >= dpth || target < 0){ 20 | return; 21 | } 22 | for (int i = start + 1; i < 10; ++i){ 23 | ans.push_back(i); 24 | dfs(i, target-i, deepth+1); 25 | ans.pop_back(); 26 | } 27 | } 28 | int dpth; 29 | vector ans; 30 | vector> res; 31 | }; 32 | 33 | int main(int argc, char *argv[]){ 34 | Solution s; 35 | auto vv = s.combinationSum3(3, 9); 36 | for (auto v : vv){ 37 | for (auto r : v){ 38 | cout << r << ", "; 39 | } 40 | cout << endl; 41 | } 42 | system("pause"); 43 | return 0; 44 | } -------------------------------------------------------------------------------- /376_WiggleMaxLength/376_WiggleMaxLength.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | int wiggleMaxLength(vector& nums) { 9 | const int n = nums.size(); 10 | if (n < 2){ 11 | return n; 12 | } 13 | int res = 1, prev = nums[0], i = 1; 14 | while (i < n && nums[i] == nums[i-1]){ 15 | ++i; 16 | } 17 | if (i == n){ 18 | return res; 19 | } 20 | bool inc = (nums[i] > nums[i-1]); 21 | ++i; ++res; 22 | for (; i < n; ++i){ 23 | if (nums[i] > nums[i - 1]){ 24 | if (!inc){ 25 | res++; 26 | inc = true; 27 | } 28 | } else if (nums[i] < nums[i - 1]){ 29 | if (inc){ 30 | res++; 31 | inc = false; 32 | } 33 | } 34 | } 35 | return res; 36 | } 37 | }; 38 | 39 | int main(int argc, char *argv[]){ 40 | Solution s; 41 | cout << s.wiggleMaxLength(vector{1, 2, 3, 4, 5, 6, 7, 8, 9}) << endl; 42 | system("pause"); 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /198_HouseRobber/198_HouseRobber.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int rob(vector& nums) { 10 | const int n = nums.size(); 11 | if (n == 0){ 12 | return 0; 13 | } 14 | int cur = nums[0], prev = nums[0], pprev = 0; 15 | for (int i = 1; i < n; ++i){ 16 | cur = max(pprev + nums[i], prev); 17 | pprev = prev; 18 | prev = cur; 19 | } 20 | return cur; 21 | } 22 | 23 | int robNSpace(vector& nums) { 24 | const int n = nums.size(); 25 | if (n == 0){ 26 | return 0; 27 | } 28 | vector dp(n+1, 0); 29 | dp[1] = nums[0]; 30 | for (int i = 1; i < n; ++i){ 31 | dp[i + 1] = max(dp[i - 1] + nums[i], dp[i]); 32 | } 33 | return dp[n]; 34 | } 35 | }; 36 | 37 | int main(int argc, char *argv[]){ 38 | Solution s; 39 | cout << s.rob(vector{1, 2, 3, 4, 5, 6, 7, 7, 6, 7, 7, 3, 6, 4, 7}) << endl; 40 | system("pause"); 41 | return 0; 42 | } -------------------------------------------------------------------------------- /Sort/MergeSort.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Introduction to Algorithm 3 | Peng Chao, 3,Apr 4 | Line: 55 5 | */ 6 | 7 | #include 8 | #include 9 | 10 | int merge(int *a, int p, int q, int r){ 11 | 12 | int nl = q - p + 1; 13 | int nr = r - q; 14 | 15 | int *L = new int[nl+1]; 16 | int *R = new int[nr+1]; 17 | 18 | for (int ii = 0; ii < nl; ++ii){ 19 | L[ii] = a[p+ii]; 20 | } 21 | L[nl] = INT_MAX; 22 | 23 | for (int ii = 0; ii < nr; ++ii){ 24 | R[ii] = a[q+ii+1]; 25 | } 26 | R[nr] = INT_MAX; 27 | 28 | int i = 0, j = 0; 29 | 30 | for (int k = p; k <= r; ++k){ 31 | if (L[i] <= R[j]){ 32 | a[k] = L[i]; 33 | i++; 34 | } else{ 35 | a[k] = R[j]; 36 | j++; 37 | } 38 | } 39 | 40 | delete[] L, R; 41 | return 0; 42 | } 43 | 44 | 45 | int mergeSort(int *a, int p, int r){ 46 | if (p < r){ 47 | int q = p + (r - p) / 2; 48 | mergeSort(a, p, q); 49 | mergeSort(a, q+1, r); 50 | merge(a, p, q, r); 51 | } 52 | 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /008_Atoi/008_Atoi.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | class Solution { 9 | public: 10 | int myAtoi(string str){ 11 | int sign = 1, base = 0, i = 0; 12 | while (str[i] == ' '){ 13 | ++i; 14 | } 15 | if (str[i] == '-' || str[i] == '+'){ 16 | sign = 1 - 2 * (str[i++] == '-'); 17 | } 18 | while (str[i] >= '0' && str[i] <= '9'){ 19 | if (base > INT_MAX / 10 || (base == INT_MAX / 10 && str[i] - '0' > 7)){ 20 | if (sign == 1){ 21 | return INT_MAX; 22 | } else{ 23 | return INT_MIN; 24 | } 25 | } 26 | base = 10 * base + (str[i++] - '0'); 27 | } 28 | return base * sign; 29 | } 30 | 31 | int myAtoiSS(string str) { 32 | stringstream ss; 33 | int res = 0; 34 | ss << str; 35 | ss >> res; 36 | return res; 37 | } 38 | }; 39 | 40 | int main(int argc, char *argv[]){ 41 | Solution s; 42 | cout << s.myAtoi("1") << endl; 43 | system("pause"); 44 | return 0; 45 | } -------------------------------------------------------------------------------- /040_CombinationSumII/040_CombinationSumII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | vector> combinationSum2(vector& candidates, int target) { 10 | sort(candidates.begin(), candidates.end()); 11 | vectortmp; 12 | dfs(candidates, target, tmp, 0); 13 | return s; 14 | } 15 | private: 16 | 17 | void dfs(vector& candidates, int target, vector&tmp, int cur){ 18 | if (target < 0) return; 19 | if (target == 0){ 20 | s.push_back(tmp); 21 | return; 22 | } 23 | for (int i = cur; i < candidates.size(); i++){ 24 | if (cur != i&&candidates[i] == candidates[i - 1]) continue;//i-1,i 25 | tmp.push_back(candidates[i]); 26 | dfs(candidates, target - candidates[i], tmp, i + 1); 27 | tmp.pop_back(); 28 | } 29 | } 30 | 31 | vector > s; 32 | }; 33 | 34 | int main(int argc, char *argv[]){ 35 | Solution s; 36 | system("pause"); 37 | return 0; 38 | } -------------------------------------------------------------------------------- /081_SearchRotatedArrayII/081_SearchRotatedArrayII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | bool search(vector& nums, int target) { 9 | const int n = nums.size(); 10 | if (n == 0){ 11 | return false; 12 | } 13 | int l = 0, r = n - 1; 14 | while (l <= r){ 15 | int m = (l + r) / 2; 16 | if (nums[m] == target){ 17 | return true; 18 | } 19 | if (nums[m] > nums[l]){ 20 | if (nums[l] <= target && target <= nums[m]){ 21 | r = m - 1; 22 | } else{ 23 | l = m + 1; 24 | } 25 | } else if(nums[m] < nums[l]){ 26 | if (target >= nums[l] || target <= nums[m]){ 27 | r = m - 1; 28 | } else{ 29 | l = m + 1; 30 | } 31 | } else{ 32 | l++; 33 | } 34 | } 35 | return false; 36 | } 37 | }; 38 | 39 | int main(int argc, char *argv[]){ 40 | Solution s; 41 | cout << s.search(vector{4, 5, 6, 7, 0, 1, 2}, 3) << endl; 42 | system("pause"); 43 | return 0; 44 | } -------------------------------------------------------------------------------- /234_PalindromeLinkedList/234_PalindromeLinkedList.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | struct ListNode { 6 | int val; 7 | ListNode *next; 8 | ListNode(int x) : val(x), next(NULL) {} 9 | }; 10 | 11 | class Solution { 12 | public: 13 | bool isPalindrome(ListNode* head) { 14 | if (!head || !head->next){ 15 | return true; 16 | } 17 | ListNode *hd = NULL;; 18 | ListNode *slow = head, *fast = head; 19 | while (fast && fast->next){ 20 | fast = fast->next->next; 21 | auto ts = slow->next; 22 | slow->next = hd; 23 | hd = slow; 24 | slow = ts; 25 | } 26 | if (fast){ 27 | slow = slow->next; 28 | } 29 | while (slow && hd){ 30 | if (slow->val == hd->val){ 31 | slow = slow->next; 32 | hd = hd->next; 33 | } else{ 34 | return false; 35 | } 36 | } 37 | return true; 38 | } 39 | }; 40 | 41 | int main(int argc, char* argv[]){ 42 | Solution s; 43 | cout << s.isPalindrome(NULL) << endl; 44 | system("pause"); 45 | return 0; 46 | } -------------------------------------------------------------------------------- /244_ShortestDistanceII/244_ShortestDistanceII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | using namespace std; 8 | 9 | class WordDistance { 10 | public: 11 | WordDistance(vector words) { 12 | for (int i = 0; i < words.size(); ++i){ 13 | hash[words[i]].push_back(i); 14 | } 15 | } 16 | 17 | int shortest(string word1, string word2) { 18 | int i = 0, j = 0, dist = INT_MAX; 19 | while (i < hash[word1].size() && j < hash[word2].size()) { 20 | int id1 = hash[word1][i]; 21 | int id2 = hash[word2][j]; 22 | dist = min(dist, abs(id1 - id2)); 23 | (id1 > id2) ? ++j : ++i; 24 | } 25 | return dist; 26 | } 27 | private: 28 | unordered_map> hash; 29 | }; 30 | 31 | int main(int argc, char *argv[]){ 32 | WordDistance w(vector{"practice", "makes", "perfect", "coding", "makes"}); 33 | cout << w.shortest("coding", "practice") << endl; 34 | system("pause"); 35 | return 0; 36 | } -------------------------------------------------------------------------------- /299_BullsAndCows/299_BullsAndCows.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | class Solution { 9 | public: 10 | string getHint(string secret, string guess) { 11 | const int n = secret.size(); 12 | int bull = 0, cows = 0; 13 | if (n == 0){ 14 | return string(""); 15 | } 16 | 17 | vector bucket_s(10, 0), bucket_t(10, 0); 18 | vector mask(n, false); 19 | for (int i = 0; i < n; ++i){ 20 | if (secret[i] == guess[i]){ 21 | bull++; 22 | } else{ 23 | bucket_s[secret[i] - '0']++; 24 | bucket_t[guess[i] - '0']++; 25 | } 26 | } 27 | 28 | for (int i = 0; i < 10; ++i){ 29 | cows += min(bucket_s[i], bucket_t[i]); 30 | } 31 | 32 | char buf[20]; 33 | sprintf(buf, "%dA%dB", bull, cows); 34 | return string(buf); 35 | } 36 | }; 37 | 38 | int main(int argc, char *argv[]){ 39 | Solution s; 40 | cout << s.getHint("1879", "1890") << endl; 41 | system("pause"); 42 | return 0; 43 | } -------------------------------------------------------------------------------- /036_ValidSudoku/036_ValidSudoku.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | bool isValidSudoku(vector>& board) { 9 | bool maskb[9][9] = {false}; //i % 3 + j /3 10 | bool maskr[9][9] = {false}; //i 11 | bool maskc[9][9] = {false}; //j 12 | for (int i = 0; i < 9; ++i){ 13 | int tp = i / 3; 14 | for (int j = 0; j < 9; ++j){ 15 | int t = tp * 3 + j / 3; 16 | if (board[i][j] == '.'){ 17 | continue; 18 | } 19 | auto& m1 = maskb[t][board[i][j]-'1']; 20 | auto& m2 = maskc[i][board[i][j]-'1']; 21 | auto& m3 = maskr[j][board[i][j]-'1']; 22 | if (m1 || m2 || m3){ 23 | return false; 24 | } 25 | m1 = true; 26 | m2 = true; 27 | m3 = true; 28 | } 29 | } 30 | return true; 31 | } 32 | }; 33 | 34 | int main(int argc, char *argv[]){ 35 | Solution s; 36 | vector> board = {}; 37 | cout << s.isValidSudoku(board) << endl; 38 | system("pause"); 39 | return 0; 40 | } -------------------------------------------------------------------------------- /064_MinPathSum/064_MinPathSum.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int minPathSum(vector>& grid) { 10 | const int m = grid.size(); 11 | const int n = grid[0].size(); 12 | vector> sum(m, vector(n, 0)); 13 | for (int i = 1; i < m; ++i){ 14 | sum[i][0] = sum[i - 1][0] + grid[i - 1][0]; 15 | } 16 | for (int j = 1; j < n; ++j){ 17 | sum[0][j] = sum[0][j - 1] + grid[0][j - 1]; 18 | } 19 | for (int i = 1; i < m; ++i){ 20 | for (int j = 1; j < n; ++j){ 21 | sum[i][j] = min(sum[i - 1][j] + grid[i - 1][j], sum[i][j - 1] + grid[i][j - 1]); 22 | } 23 | } 24 | return sum[m - 1][n - 1] + grid[m - 1][n - 1]; 25 | } 26 | }; 27 | 28 | int main(int argc, char *argv[]){ 29 | Solution s; 30 | vector> grid{ { 1, 2, 3, 4 }, { 2, 3, 4, 5 }, { 3, 4, 5, 4 }, { 4, 5, 6, 7 } }; // 26 31 | cout << s.minPathSum(grid) << endl; 32 | system("pause"); 33 | return 0; 34 | } -------------------------------------------------------------------------------- /050_Pow/050_Pow.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /502_IPO/502_IPO.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /582_KillProcess/582_KillProcess.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | using namespace std; 7 | 8 | class Solution { 9 | public: 10 | vector killProcess(vector& pid, vector& ppid, int kill) { 11 | if (kill == 0){ 12 | return{}; 13 | } 14 | unordered_map> graph; 15 | const int n = pid.size(); 16 | for (int i = 0; i < n; ++i){ 17 | graph[ppid[i]].push_back(pid[i]); 18 | } 19 | vector res; 20 | queue q; 21 | q.push(kill); 22 | while (!q.empty()){ 23 | auto t = q.front(); 24 | res.push_back(t); 25 | q.pop(); 26 | for (int i = 0; i < graph[t].size(); ++i){ 27 | q.push(graph[t][i]); 28 | } 29 | } 30 | return res; 31 | } 32 | }; 33 | 34 | int main(int argc, char *argv[]){ 35 | Solution s; 36 | auto vs = s.killProcess(vector{1, 2, 10, 5}, vector{3, 0, 5, 3}, 5); 37 | for (auto v : vs){ 38 | cout << v << ", "; 39 | } 40 | system("pause"); 41 | return 0; 42 | } -------------------------------------------------------------------------------- /008_Atoi/008_Atoi.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /069_Sqrt/069_Sqrt.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /090_SubsetsII/090_SubsetsII.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | vector> subsetsWithDup(vector& nums) { 10 | n = nums.size(); 11 | vector ans; 12 | sort(nums.begin(), nums.end()); 13 | dfs(0, ans, nums); 14 | return res; 15 | } 16 | 17 | private: 18 | void dfs(int start, vector& ans,vector& nums){ 19 | res.push_back(ans); 20 | for (int i = start; i < n; ++i){ 21 | if (i != start && nums[i] == nums[i - 1]){ 22 | continue; 23 | } 24 | ans.push_back(nums[i]); 25 | dfs(i + 1, ans, nums); 26 | ans.pop_back(); 27 | } 28 | } 29 | vector> res; 30 | int n; 31 | }; 32 | 33 | int main(int argc, char *argv[]){ 34 | Solution s; 35 | auto subsets = s.subsetsWithDup(vector{1, 2, 2}); 36 | for (auto vv : subsets){ 37 | for (auto v : vv){ 38 | cout << v << ", "; 39 | } 40 | cout << endl; 41 | } 42 | system("pause"); 43 | return 0; 44 | } -------------------------------------------------------------------------------- /028_StrStr/028_StrStr.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /132_MinCut/132_MinCut.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /135_Candy/135_Candy.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /228_SummaryRanges/228_SummaryRanges.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | vector summaryRanges(vector& nums) { 10 | vector res; 11 | const int n = nums.size(); 12 | if (n == 0){ 13 | return{}; 14 | } 15 | 16 | char buf[50]; 17 | int start = nums[0]; 18 | int end = 0; 19 | for (int i = 1; i < n+1; ++i){ 20 | if (i == n || nums[i] - nums[i - 1] != 1){ 21 | end = nums[i - 1]; 22 | if (start == end){ 23 | sprintf(buf, "%d", start); 24 | } else{ 25 | sprintf(buf, "%d->%d", start, end); 26 | } 27 | res.push_back(string(buf)); 28 | if (i != n){ 29 | start = nums[i]; 30 | } 31 | } 32 | } 33 | return res; 34 | } 35 | }; 36 | 37 | int main(int argc, char *argv[]){ 38 | Solution s; 39 | auto vs = s.summaryRanges(vector{0, 1, 2, 4, 5, 7}); 40 | for (auto v : vs){ 41 | cout << v << ", "; 42 | } 43 | system("pause"); 44 | return 0; 45 | } -------------------------------------------------------------------------------- /274_Hindex/274_Hindex.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /287_FindDuplicate/287_FindDuplicate.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | int findDuplicate(vector& nums) { 10 | int slow = 0, fast = 0, finder = 0; 11 | while (true){ 12 | slow = nums[slow]; 13 | fast = nums[nums[fast]]; 14 | if (slow == fast) break; 15 | } 16 | while (true){ 17 | slow = nums[slow]; 18 | finder = nums[finder]; 19 | if (slow == finder) return finder; 20 | } 21 | return finder; 22 | } 23 | 24 | int findDuplicateMy(vector& nums) { 25 | const int n = nums.size(); 26 | if (n < 2){ 27 | return 0; 28 | } 29 | sort(nums.begin(), nums.end()); 30 | for (int i = 1; i < n; ++i){ 31 | if (nums[i] == nums[i - 1]){ 32 | return nums[i]; 33 | } 34 | } 35 | return 0; 36 | } 37 | }; 38 | 39 | int main(int argc, char *argv[]){ 40 | Solution s; 41 | cout << s.findDuplicate(vector{2, 2, 2, 2, 2}) << endl; 42 | system("pause"); 43 | return 0; 44 | } 45 | -------------------------------------------------------------------------------- /011_MaxArea/011_MaxArea.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /015_ThreeSum/015_ThreeSum.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /018_FourSum/018_FourSum.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /051_NQueens/051_NQueens.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /055_JumpGame/055_JumpGame.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /078_Subsets/078_Subsets.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /089_GrayCode/089_GrayCode.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /104_MaxDepth/104_MaxDepth.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /112_PathSum/112_PathSum.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /146_LRUCache/146_LRUCache.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /148_SortList/148_SortList.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /155_MinStack/155_MinStack.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /179_LargestNumber/179_LargestNumber.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace std; 9 | 10 | class Solution { 11 | public: 12 | string largestNumber(vector& nums) { 13 | vector strs; 14 | stringstream ss; 15 | string str; 16 | for (auto num : nums){ 17 | ss.clear(); 18 | ss << num; 19 | ss >> str; 20 | strs.push_back(str); 21 | } 22 | auto cmp = [](const string &lhs, const string &rhs)->bool{ 23 | return lhs + rhs > rhs + lhs; // Important 24 | }; 25 | sort(strs.begin(), strs.end(), cmp); 26 | str.clear(); 27 | for (auto s : strs){ 28 | str += s; 29 | } 30 | str.erase(0, str.find_first_not_of("0")); 31 | if (!str.length()){ 32 | str = "0"; 33 | } 34 | return str; 35 | } 36 | }; 37 | 38 | int main(int argc, char *argv[]){ 39 | Solution s; 40 | cout << s.largestNumber(vector{3, 30, 34, 5, 9}) << endl; 41 | system("pause"); 42 | return 0; 43 | } -------------------------------------------------------------------------------- /218_SkyLine/218_SkyLine.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /231_PowerTwo/231_PowerTwo.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /275_HindexII/275_HindexII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /292_NimGame/292_NimGame.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /372_SuperPow/372_SuperPow.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /052_NQueensII/052_NQueensII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /067_AddBinary/067_AddBinary.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /076_MinWindow/076_MinWindow.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /090_SubsetsII/090_SubsetsII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /096_UniqueBST/096_UniqueBST.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /113_PathSumII/113_PathSumII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /121_MaxProfit/121_MaxProfit.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /139_WordBreak/139_WordBreak.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /149_MaxPoints/149_MaxPoints.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /170_TwoSumIII/170_TwoSumIII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /283_MoveZeros/283_MoveZeros.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /311_SparseMatrixMultiplication/311_SparseMatrixMultiplication.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | vector> multiply(vector>& A, vector>& B) { 9 | const int n1 = A.size(), n2 = B.size(), n3 = B[0].size(); 10 | vector> C(n1, vector(n3, 0)); 11 | for (int i = 0; i < n1; ++i){ 12 | for (int j = 0; j < n2; ++j){ 13 | if (A[i][j]){ 14 | for (int k = 0; k < n3; ++k){ 15 | C[i][k] += A[i][j] * B[j][k]; 16 | } 17 | } 18 | } 19 | } 20 | return C; 21 | } 22 | }; 23 | 24 | int main(int argc, char *argv[]){ 25 | Solution s; 26 | vector> A{ 27 | { 1, 0, 0 }, 28 | { -1, 0, 3 } }; 29 | vector> B{ 30 | { 7, 0, 0 }, 31 | { 0, 0, 0 }, 32 | { 0, 0, 1 } }; 33 | auto mat = s.multiply(A, A); 34 | for (auto line : mat){ 35 | for (auto v : line){ 36 | cout << v << ", "; 37 | } 38 | cout << endl; 39 | } 40 | system("pause"); 41 | return 0; 42 | } -------------------------------------------------------------------------------- /380_RandomSet/380_RandomSet.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /454_FourSumII/454_FourSumII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /009_PalindromeNumber/009_PalindromeNumber.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace std; 4 | 5 | class Solution { 6 | public: 7 | bool isPalindrome(int x){ 8 | if (x < 0){ 9 | return false; 10 | } 11 | int y = 0, z = x; 12 | while (z) { 13 | y = 10 * y + z % 10; 14 | z /= 10; 15 | } 16 | return x == y; 17 | } 18 | 19 | bool isPalindromeMyAC(int x) { 20 | if (x < 0){ 21 | return false; 22 | } 23 | if (x < 10){ 24 | return true; 25 | } 26 | int n = 0; 27 | int y = x; 28 | while (y > 0){ 29 | y = y / 10; 30 | n++; 31 | } 32 | while (n > 1){ 33 | int s = x - (x /10) * 10; 34 | int t = pow(10, n-1); 35 | int m = x - s * t - s; 36 | if (m < 0){ 37 | return false; 38 | } 39 | if (m / t != 0){ 40 | return false; 41 | } 42 | n = n - 2; 43 | x = m / 10; 44 | } 45 | return true; 46 | } 47 | }; 48 | 49 | int main(int argc, char *argv[]){ 50 | Solution s; 51 | cout << s.isPalindrome(111332111) << endl; 52 | system("pause"); 53 | return 0; 54 | } -------------------------------------------------------------------------------- /023_MergeKLists/023_MergeKLists.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /034_SearchRange/034_SearchRange.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /036_ValidSudoku/036_ValidSudoku.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /045_JumpGameII/045_JumpGameII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /046_Permutations/046_Permutations.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class Solution { 7 | public: 8 | vector> permute(vector& nums) { 9 | n = nums.size(); 10 | vector mask(n, true); 11 | dfs(nums, mask, 0); 12 | return res; 13 | } 14 | private: 15 | void dfs(vector& nums, vector& mask, int depth){ 16 | if (depth == n){ 17 | res.push_back(ans); 18 | return; 19 | } 20 | for (int i = 0; i < n; ++i){ 21 | if (mask[i]){ 22 | ans.push_back(nums[i]); 23 | mask[i] = false; 24 | dfs(nums, mask, depth+1); 25 | mask[i] = true; 26 | ans.pop_back(); 27 | } 28 | } 29 | } 30 | int n; 31 | vector ans; 32 | vector> res; 33 | }; 34 | 35 | int main(int argc, char *argv[]){ 36 | Solution s; 37 | auto matrix = s.permute(vector{1, 2, 3}); 38 | for (auto line : matrix){ 39 | for (auto v : line){ 40 | cout << v << ", "; 41 | } 42 | cout << endl; 43 | } 44 | system("pause"); 45 | return 0; 46 | } -------------------------------------------------------------------------------- /048_RotateImage/048_RotateImage.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /053_MaxSubArray/053_MaxSubArray.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /061_RotateList/061_RotateList.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /062_UniquePaths/062_UniquePaths.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /064_MinPathSum/064_MinPathSum.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /075_SortColors/075_SortColors.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /079_WordSearch/079_WordSearch.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /091_DecodeWays/091_DecodeWays.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /095_UniqueBSTII/095_UniqueBSTII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /098_ValidateBST/098_ValidateBST.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /099_RecoverBST/099_RecoverBST.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /102_LevelOrder/102_LevelOrder.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /122_MaxProfitII/122_MaxProfitII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /124_MaxPathSum/124_MaxPathSum.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /127_WordLadder/127_WordLadder.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /129_SumNumbers/129_SumNumbers.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /133_CloneGraph/133_CloneGraph.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /134_GasStation/134_GasStation.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /140_WordBreakII/140_WordBreakII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /143_ReorderList/143_ReorderList.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /152_MaxProduct/152_MaxProduct.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /164_Maximum_Gap/164_Maximum_Gap.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /173_BSTIterator/173_BSTIterator.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /174_DungeonGame/174_DungeonGame.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /188_MaxProfitIV/188_MaxProfitIV.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /189_RotateArray/189_RotateArray.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /190_ReverseBits/190_ReverseBits.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /198_HouseRobber/198_HouseRobber.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /202_HappyNumber/202_HappyNumber.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /204_CountPrimes/204_CountPrimes.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /208_PrefixTree/208_PrefixTree.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /222_CountNodes/222_CountNodes.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /263_UglyNumber/263_UglyNumber.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /290_WordPattern/290_WordPattern.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /322_CoinChange/322_CoinChange.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /326_PowerThree/326_PowerThree.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /378_KthSmallest/378_KthSmallest.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /383_RansomNote/383_RansomNote.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /437_PathSumIII/437_PathSumIII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /524_LongestWord/524_LongestWord.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /582_KillProcess/582_KillProcess.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /616_AddBoldTag/616_AddBoldTag.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /021_MergeTwoLists/021_MergeTwoLists.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /025_ReverseKGroup/025_ReverseKGroup.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /027_RemoveElement/027_RemoveElement.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /030_FindSubstring/030_FindSubstring.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /037_SudokuSolver/037_SudokuSolver.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /046_Permutations/046_Permutations.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /049_GroupAnagrams/049_GroupAnagrams.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /054_SpiralMatrix/054_SpiralMatrix.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /063_UniquePathII/063_UniquePathII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /072_EditDistance/072_EditDistance.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /074_SearchMatrix/074_SearchMatrix.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /077_Combinations/077_Combinations.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /086_PartitionList/086_PartitionList.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /087_ScrambleString/087_ScrambleString.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | using namespace std; 6 | 7 | class Solution { 8 | public: 9 | bool isScramble(string s1, string s2) { 10 | if (s1 == s2){ 11 | return true; 12 | } 13 | const int len = s1.size(); 14 | int count[26] = { 0 }; 15 | for (int i = 0; i < len; ++i){ 16 | count[s1[i] - 'a']++; 17 | count[s2[i] - 'a']--; 18 | } 19 | 20 | for (int i = 0; i < 26; ++i){ 21 | if (count[i]){ 22 | return false; 23 | } 24 | } 25 | 26 | for (int i = 1; i < len; ++i){ 27 | if (isScramble(s1.substr(0,i), s2.substr(0,i)) && isScramble(s1.substr(i),s2.substr(i))){ 28 | return true; 29 | } 30 | if (isScramble(s1.substr(0,i), s2.substr(len-i)) && isScramble(s1.substr(i), s2.substr(0, len-i))){ 31 | return true; 32 | } 33 | } 34 | return false; 35 | } 36 | }; 37 | 38 | int main(int argc, char *argv[]){ 39 | Solution s; 40 | cout << s.isScramble("ab", "ba") << endl; 41 | system("pause"); 42 | return 0; 43 | } 44 | -------------------------------------------------------------------------------- /101_SymmetricTree/101_SymmetricTree.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /123_MaxProfitIII/123_MaxProfitIII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /126_WordLadderII/126_WordLadderII.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /136_SingleNumber/136_SingleNumber.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | --------------------------------------------------------------------------------