Welcome to Scala Algorithms!

The table of Scala Algorithms
#1Check if an array is a palindrome in pure immutable ScalaCheck if an array is a palindrome in pure immutable Scala

Free

#2Balanced parentheses algorithm in immutable/pure functional Scala with tail-call recursion optimisationBalanced parentheses algorithm in immutable/pure functional Scala with tail-call recursion optimisation

Free

#3Find an unpaired number in an arrayFind an unpaired number in an array

Free

#4Count binary gap size of a number in immutable/pure functional Scala using tail recursionCount binary gap size of a number in immutable/pure functional Scala using tail recursion

Free

#5Find maximum potential profit from an array of stock prices - pure-functional immutable Scala solutionFind maximum potential profit from an array of stock prices - pure-functional immutable Scala solution

Free

#6Fizz Buzz in purely functional immutable ScalaFizz Buzz in purely functional immutable Scala

Free

#7Find the minimum absolute difference of two partitionsFind the minimum absolute difference of two partitions

Free test cases & hints

#8Compute a Roman numeral for an Integer, and vice-versaCompute a Roman numeral for an Integer, and vice-versa

Free test cases & hints

#9Quick Sort sorting algorithm in pure immutable ScalaQuick Sort sorting algorithm in pure immutable Scala

Free test cases & hints

#10Fibonacci in purely functional immutable ScalaFibonacci in purely functional immutable Scala

Free test cases & hints

#11In a range of numbers, count the numbers divisible by a specific integer. Pure functional solutionCount numbers divisible by another

Free test cases & hints

#12Is an Array a permutation? Pure-functional & immutable Scala algorithmIs an array a permutation?

Free test cases & hints

#13Merge Sort: stack-safe, tail-recursive, in pure immutable Scala, N-wayMerge Sort: stack-safe, tail-recursive

Free test cases & hints

#14Closest pair of coordinates in a 2D planeClosest pair of coordinates in a 2D plane

Free test cases & hints

#15Counting inversions of a sequence (array) in pure-functional immutable Scala, using a Merge SortCounting inversions of a sequence

Free test cases & hints

#16Rotate Array right in pure-functional Scala - using an unusual immutable efficient approachRotate Array right in pure-functional Scala

Free test cases & hints

#17Count factors/divisors of an integer in pure-functional immutable ScalaCount factors of a number

Free test cases & hints

#18Merge Sort: in pure immutable ScalaMerge Sort: in pure immutable Scala

Free test cases & hints

#19Longest increasing sub-sequence lengthLongest increasing sub-sequence length

Free test cases & hints

#20Matching parentheses algorithm in immutable/pure functional Scala with foldLeft and a state machineMatching parentheses algorithm in immutable/pure functional Scala with foldLeft and a state machine

Free test cases & hints

#21Traverse a tree Breadth-First, immutably, and purely in ScalaTraverse a tree Breadth-First, immutably, and purely in Scala

Free test cases & hints

#22Count number of changes (manipulations) needed to make an anagram in immutable/pure functional Scala with foldLeft and a MultiSetCount number of changes for making an anagram

Free test cases & hints

#23Check if a number is a palindrome in pure immutable ScalaCheck if a number is a palindrome in pure immutable Scala

Free test cases & hints

#24Compute maximum sum of subarray (Kadane's algorithm) in purely functional immutable ScalaCompute maximum sum of subarray (Kadane's algorithm) in purely functional immutable Scala

Free test cases & hints

#25Check if a String is a palindrome in immutable ScalaCheck if a String is a palindrome in immutable Scala

Free test cases & hints

#26Find sub-array with the maximum sumFind sub-array with the maximum sum

Free test cases & hints

#27Traverse a tree Depth-First with purely-functional immutable ScalaTraverse a tree Depth-First with purely-functional immutable Scala

Free test cases & hints

#28Tic Tac Toe board checkTic Tac Toe board check

Available 6th December

#29Find the contiguous slice with the minimum averageFind the contiguous slice with the minimum average

Available 10th December

#30Run-length encoding in pure-functional immutable ScalaRun-length encoding in pure-functional immutable Scala

Available 13th December

#31Binary search a generic Array in pure functional ScalaBinary search a generic Array in pure functional Scala

Available 17th December

#32Find minimum positive number missing in a sequenceFind minimum positive number missing in a sequence

Available 20th December

#33Length of the longest common substringLength of the longest common substring

Available 24th December

#34Count number of contiguous countries by colorsCount number of contiguous countries by colors

Available 1st January

#35Read a matrix as a spiral in pure-functional immutable ScalaRead a matrix as a spiral

Available 7th January

#36Rotate a matrix by 90 degrees in pure-functional immutable ScalaRotate a matrix by 90 degrees

Available 14th January

#37Selection Search in pure-function immutable ScalaSelection Search in pure-function immutable Scala

Available 21st January

#38Monitor success rate of a process that may failMonitor success rate of a process that may fail

Available 28th January

#39Reverse a String's words efficientlyReverse a String's words efficiently

Available 4th February

#40Print Alphabet DiamondPrint Alphabet Diamond

Available 11th February

#41Compute nth row of Pascal's triangle in pure-function immutable ScalaCompute nth row of Pascal's triangle

Available 14th February

27 available Scala algorithms

A monthly unlimited subscription is available for US$3.99. Visit any paid solution to order a subscription.

  1. Check if an array is a palindrome in pure immutable Scala

    Free

  2. Balanced parentheses algorithm in immutable/pure functional Scala with tail-call recursion optimisation

    Free

  3. Find an unpaired number in an array

    Free

  4. Count binary gap size of a number in immutable/pure functional Scala using tail recursion

    Free

  5. Find maximum potential profit from an array of stock prices - pure-functional immutable Scala solution

    Free

  6. Fizz Buzz in purely functional immutable Scala

    Free

  7. Find the minimum absolute difference of two partitions

    Free test cases & hints

  8. Compute a Roman numeral for an Integer, and vice-versa

    Free test cases & hints

  9. Quick Sort sorting algorithm in pure immutable Scala

    Free test cases & hints

  10. Fibonacci in purely functional immutable Scala

    Free test cases & hints

  11. In a range of numbers, count the numbers divisible by a specific integer. Pure functional solution

    Free test cases & hints

  12. Is an Array a permutation? Pure-functional & immutable Scala algorithm

    Free test cases & hints

  13. Merge Sort: stack-safe, tail-recursive, in pure immutable Scala, N-way

    Free test cases & hints

  14. Closest pair of coordinates in a 2D plane

    Free test cases & hints

  15. Counting inversions of a sequence (array) in pure-functional immutable Scala, using a Merge Sort

    Free test cases & hints

  16. Rotate Array right in pure-functional Scala - using an unusual immutable efficient approach

    Free test cases & hints

  17. Count factors/divisors of an integer in pure-functional immutable Scala

    Free test cases & hints

  18. Merge Sort: in pure immutable Scala

    Free test cases & hints

  19. Longest increasing sub-sequence length

    Free test cases & hints

  20. Matching parentheses algorithm in immutable/pure functional Scala with foldLeft and a state machine

    Free test cases & hints

  21. Traverse a tree Breadth-First, immutably, and purely in Scala

    Free test cases & hints

  22. Count number of changes (manipulations) needed to make an anagram in immutable/pure functional Scala with foldLeft and a MultiSet

    Free test cases & hints

  23. Check if a number is a palindrome in pure immutable Scala

    Free test cases & hints

  24. Compute maximum sum of subarray (Kadane's algorithm) in purely functional immutable Scala

    Free test cases & hints

  25. Check if a String is a palindrome in immutable Scala

    Free test cases & hints

  26. Find sub-array with the maximum sum

    Free test cases & hints

  27. Traverse a tree Depth-First with purely-functional immutable Scala

    Free test cases & hints

14 upcoming Scala algorithms

  1. Tic Tac Toe board check

    Available 6th December

  2. Find the contiguous slice with the minimum average

    Available 10th December

  3. Run-length encoding in pure-functional immutable Scala

    Available 13th December

  4. Binary search a generic Array in pure functional Scala

    Available 17th December

  5. Find minimum positive number missing in a sequence

    Available 20th December

  6. Length of the longest common substring

    Available 24th December

  7. Count number of contiguous countries by colors

    Available 1st January

  8. Read a matrix as a spiral in pure-functional immutable Scala

    Available 7th January

  9. Rotate a matrix by 90 degrees in pure-functional immutable Scala

    Available 14th January

  10. Selection Search in pure-function immutable Scala

    Available 21st January

  11. Monitor success rate of a process that may fail

    Available 28th January

  12. Reverse a String's words efficiently

    Available 4th February

  13. Print Alphabet Diamond

    Available 11th February

  14. Compute nth row of Pascal's triangle in pure-function immutable Scala

    Available 14th February