Git Product home page Git Product logo

leetcode-scala's Introduction

LeetCode-Scala

Solutions in Scala to LeetCode Problems

Problems

Easy Problems

Problem Name Problem Name Scala Solution
1 Two Sum TwoSum
2 Length of Last Word LengthOfLastWord
3 Valid Parentheses ValidParentheses
4 Palindrome Number PalindromeProblem
5 Remove Duplicates from Sorted Array RemoveDuplicates
6 Best Time to Buy and Sell Stock BestTimeToBuyStock
7 Binary Tree Inorder Traversal BinaryTreeInorderTraversal
8 Climbing Stairs ClimbingStairs
9 Maximum Subarray MaximumSubarray
10 Most Common Word MostCommonWords
11 Missing Number MissingNumber
12 Search Insert Position SearchInsertPositionProblem
13 Implement strStr() StringStr
14 Valid Anagram ValidAnagram
15 RomanInteger RomanInteger
16 RemoveElement RemoveElement
17 Remove Duplicates from Sorted Array RemoveDuplicatesSortedArray
18 Contains Duplicate ContainsDuplicates
19 Word Pattern WordPattern
20 Contains Duplicate II ContainsDuplicatesII
21 Valid Palindrome ValidPalindrome
22 Valid Palindrome II ValidPalindromeII
23 First Unique Character in a String FirstUniqueChar
24 Ransom Note RansomNote
25 Find the Difference FindDifference
26 Reverse Linked List ReverseLinkedList
27 Merge Two Sorted Lists MergeSortedLists
28 Intersection of Two Arrays IntersectionTwoArrays
29 Intersection of Two Arrays II IntersectionTwoArraysII
30 Max Consecutive Ones MaxConsecutiveOnes
31 Consecutive Characters ConsecutiveCharacters
32 Longer Contiguous Segments of Ones than Zeros LongerContiguousSegments
33 Fibonacci Number FibonacciNumber
34 Find Common Characters FindCommonCharacters
35 Best Time to Buy Sell Stock BestTimeBuySellStock
36 Min Cost Climbing Stairs MinCostClimbingStairs
37 Check if Binary String Has at Most One Segment of Ones MostOneSegmentOfOnes
38 Same Tree SameTree
39 Maximum Product of Three Numbers MaximumProductThreeNumbers
40 Find the K-Beauty of a Number KBeautyNumber
41 Longest Palindrome LongestPalindrome
42 Min Stack MinStack
43 Peak Index in a Mountain Array PeekIndexInMountainArray
44 Palindrome Linked List PalindromeLinkedList
45 Midle of the Linked List MiddleLinkedList
46 Remove Duplicates from Sorted List RemoveDuplicatesFromSortedLinkedList
47 Linked List Cycle LinkedListCycle
48 Remove Linked List Elements RemoveLinkedListElements
49 Design HashSet DesignHashSet
50 Design HashMap DesignHashMap
51 Move Zeroes MoveZeros
52 Summary Ranges SummaryRanges
53 Transpose Matrix TransposeMatrix
54 Running Sum of 1d Array RunningSum1dArray
55 Merge Sorted Array MergeSortedArray
56 Squares of a Sorted Array SquaresSortedArray
57 ReplaceElementsWithGreatestElementOnRightSide ReplaceElementsWithGreatestElementOnRightSide
58 SqrtX SqrtX
59 Path Sum PathSum
60 Merge Two Binary Trees MergeTwoBinaryTrees
61 Convert Sorted Array to Binary Search Tree ConcertSortedArrayToBinarySearchTree
62 Most Frequent Even Element MostFrequentEvenElement
63 Rotate Array RotateArray
64 Convert Binary Number in a Linked List to Integer ConvertLinkedListToBinaryNumber
65 Check If Two String Arrays are Equivalent CheckIfTwoStringArraysAreEquivalent
66 Intersection of Two Linked Lists IntersectionOfTwoLinkedLists
67 Balanced Binary Tree BalancedBinaryTree
68 Binary Tree Paths BinaryTreePaths
69 Sum of Left Leaves SumOfLeftLeaves
70 Subtree of Another Tree SubtreeOfAnotherTree
71 Construct String from Binary Tree ConstructStringFromBinaryTree
72 Average of Levels in Binary Tree AverageLevelsInBinaryTree
73 N-ary Tree Preorder Traversal NTreePreorderTraversal
74 N-ary Tree Postorder Traversal NTreePostorderTraversal
75 Counting Bits CountingBits
76 Find Pivot Index FindPivotIndex
77 Is Subsequence IsSubsequence
78 Toeplitz Matrix ToeplitzMatrix
79 Maximum Depth of N-ary Tree MaximumDepthOfNTree
80 First Bad Version FirstBadVersn
81 Reverse Vowels of a String ReverseVowelsOfAString
82 Maximum 69 Number Maximum69Number
83 Make The String Great MakeTheStringGreat
84 Remove All Adjacent Duplicates In String RemoveAllAdjacentDuplicatesInString
85 Add to Array-Form of Integer AddToArrayFormOfInteger
86 Binary Search BinarySearch
87 Flood Fill FloodFill
88 Guess Number Higher or Lower GuessNumberHigherOrLower
89 Ugly Number UglyNumber
90 N-th Tribonacci Number NTribonacciNumber
91 Determine if String Halves Are Alike DetermineIfStringHalvesAreAlike
92 Range Sum Of Bst RangeSumOfBst
93 Leaf-Similar Trees LeafSimilarTrees
94 Implement Queue using Stacks ImplementQueueUsingStacks
95 Longest Subsequence With Limited Sum LongestSubsequenceWithLimitedSum

Medium Problems

Problem Name Problem Name Scala Solution
1 Two Sum II TwoSumII
2 Add Two Numbers AddTwoNumbers
3 HouseRobber HouseRobber
4 LongestPalindromicSubstring LongestPalindromicSubstring
5 atoi AtoiProblem
6 LongestSubstring LongestSubstring
7 Reverse Integer Reverse Integer
8 Maximum Product Subarray MaximumProductSubarray
9 3Sum 3Sum
10 Letter Combinations of a Phone Number PhoneNumberLetterCombinations
11 Remove Nth Node From End of List RemoveNthNodeFromEndOfList
12 Zigzag Conversion ZigzagConversion
13 Container With Most Watter ContainerWithMostWatter
14 Group Anagrams Group Anagrams
15 Swap Nodes in Pairs SwapNodesInPairs
16 Search in Rotated Sorted Array SearchTargetInRotatedSortedArray
17 Integer to Roman IntegerToRoman
18 Find First and Last Position of Element in Sorted Array FirstLastPositionOfElementInSortedArray
19 Permutations Permutations
20 Merge Intervals MergeIntervals
21 Majority Element II MajorityElements
22 Jump Game JumpGame
23 Insert Interval InsertInterval
24 Longest Consecutive Sequence LongestConsecutiveSequence
25 Reverse Words in a String ReverseWords
26 House Robber II HouseRobberII
27 Coin Change CoinChange
28 Product of Array Except Self ProductOfArrayExceptSelf
29 Jump Game II JumpGameII
30 Subset Subset
31 Subset II SubsetII
32 Minimum Size Subarray Sum MinimumSizeSubarraySum
33 Find Peak Element FindPeakElement
34 Delete the Middle Node of a Linked List DeleteMiddleNodeLinkedList
35 LRU Cache LruCache
36 Remove Duplicates from Sorted Array II RemoveDuplicatesSortedArrayII
37 Sum of Subarray Minimums SumOfSubarrayMinimums
38 Binary Tree Level Order Traversal BinaryTreeLevelOrderTraversal
39 Convert Sorted List to Binary Search Tree SortedListToBinarySearchTree
39 Binary Tree Zigzag Level Order Traversal BinaryTreeZigzagLevelOrderTraversal
40 Search in Rotated Sorted Array II SearchInRotatedSortedArrayII
41 Top K Frequent Elements TopKFrequentElements
42 Top K Frequent Words TopKFrequentWords
43 Sort Characters By Frequency SortCharactersByFrequency
44 Rotate List RotateList
45 Binary Tree Level Order Traversal II BinaryTreeLevelOrderTraversalII
46 N-ary Tree Level Order Traversal NTreeLevelOrderTraversal
47 Where Will the Ball Fall WhereWillTheBallFall
48 Number of Matching Subsequences NumberOfMatchingSubsequence
49 Minimum Genetic Mutation Minimum Genetic Mutation
50 Linked List Cycle II LinkedListCycleII
51 Longest Palindrome by Concatenating Two Letter Words LongestPalindromeConcatenatingTwoLetterWords
52 Word Search WordSearch
53 Reverse Linked List II ReverseLinkedListII
54 Online Stock Span OnlineStockSpan
55 Best Time to Buy and Sell Stock II BestTimeToBuyAndSellStockII
56 Best Time to Buy and Sell Stock with Transaction Fee BestTimeToBuyAndSellStockWithTransactionFee
57 Remove All Adjacent Duplicates in String II RemoveAllAdjacentDuplicatesInStringII
58 Validate Binary Search Tree ValidateBinarySearchTree
59 Lowest Common Ancestor of a Binary Search Tree LowestCommonAncestorBinarySearchTree
60 Count Complete Tree Nodes CountCompleteTreeNodes
61 Rectangle Area RectangleArea
62 Nearest Exit from Entrance in Maze NearestExitFromEntranceInMaze
63 Perfect Squares PerfectSquares
64 Find Players With Zero or One Losses FindPlayersWithZeroOrOneLosses
65 Insert Delete GetRandom O(1) RandomizedSet
66 Find All Anagrams in a String FindAllAnagramsInAString
67 Minimum Average Difference MinimumAverageDifference
68 Determine if Two Strings Are Close DetermineIfTwoStringsAreClose
69 Delete and Earn DeleteAndEarn
70 Odd Even Linked List OddEvenLinkedList
71 Maximum Difference Between Node and Ancestor MaximumDifferenceBetweenNodeAncestor
72 Maximum Product of Splitted Binary Tree MaximumProductOfSplittedBinaryTree
73 Minimum Falling Path Sum MinimumFallingPathSum
74 Longest Common Subsequence LongestCommonSubsequence
75 Evaluate Reverse Polish Notatione EvaluateReversePolishNotation$
76 Daily Temperatures DailyTemperatures
77 Keys and Rooms KeysAndRooms
78 Possible Bipartition PossibleBipartition
79 Domino and Tromino Tiling DominoAndTrominoTiling
80 Maximum Bags With Full Capacity of Rocks MaximumBagsWithFullCapacityOfRocks
81 Maximum Ice Cream Bars MaximumIceCreamBars

Hard Problems

Problem Name Problem Name Scala Solution
1 Longest Valid Parentheses LongestValidParentheses
2 Median of Two Sorted Arrays MedianOfTwoSortedArray
3 First Missing Positive FirstMissingPositive
4 Sliding Window Maximum SlidingWindowMaximum
5 Merge k Sorted Lists MergeSortedLists
6 Orderly Queus Orderly Queus
7 Find Median from Data Stream FindMedianFromDataStream
8 Erect the Fence ErectTheFence
9 Basic Calculator BasicCalculator
10 Maximum Profit in Job Scheduling MaximumProfitInJobScheduling
11 Binary Tree Maximum Path Sum BinaryTreeMaximumPathSum

LeetCode-SQL

Problems

Easy Problems

Problem Name Problem Name SQL Solution
1 Big Countries BigCountries
2 Recyclable and Low Fat Products RecyclableLowFatProducts
3 Find Customer Referee FindCustomerReferee
4 Customers Who Never Order CustomersWhoNeverOrder
5 Calculate Special Bonus CalculateSpecialBonus
6 Delete Duplicate Emails DeleteDuplicateEmails
7 Swap Salary SwapSalary
8 Fix Names in a Table FixNamesTables

leetcode-scala's People

Contributors

vpovarna avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.