hackerrank v0.1.0 FP.Structures

Elixir solutions for HackerRank functional programming challenges: functional structures.

Link to this section Summary

Functions

Substring searching by KMP algorithm

John and fences 1

John and fences 2 - more time-performant

Order exercises (advanced) - find multiple maximum subarray sums given an array

Range minimum query - find multiple subarrays minimums

Matrix rotation

Binary tree: swap and traverse nodes

Link to this section Functions

Link to this function

kmp_string_search(string, pattern)
kmp_string_search(binary(), binary()) :: binary()
kmp_string_search(list(), list()) :: binary()

Substring searching by KMP algorithm

https://www.hackerrank.com/challenges/kmp-fp/problem

Link to this function

max_rect(heights)
max_rect([integer()]) :: integer()

John and fences 1

https://www.hackerrank.com/challenges/john-and-fences/problem

Link to this function

max_rect_divide(heights, n)
max_rect_divide([integer()], integer()) :: integer()

John and fences 2 - more time-performant

https://www.hackerrank.com/challenges/john-and-fences/problem

Link to this function

max_subarray_sums(a, n, k)
max_subarray_sums([integer()], integer(), integer()) :: [integer()]

Order exercises (advanced) - find multiple maximum subarray sums given an array

https://www.hackerrank.com/challenges/order-exercises/problem

Link to this function

min_query_tree(a, n, queries)
min_query_tree([integer()], integer(), [tuple()]) :: list()

Range minimum query - find multiple subarrays minimums

https://www.hackerrank.com/challenges/range-minimum-query/problem

Link to this function

rotate(matrix, times)
rotate(list(), integer()) :: list()

Matrix rotation

https://www.hackerrank.com/challenges/matrix-rotation/problem

Link to this function

swap_nodes(data)
swap_nodes(list()) :: list()

Binary tree: swap and traverse nodes

https://www.hackerrank.com/challenges/swap-nodes/problem