hackerrank v0.1.0 FP.Recursion.Advanced

Elixir solutions for advanced HackerRank functional programming challenges: recursions.

Link to this section Summary

Functions

Crosswords-101

Functions and Fractals - Recursive Trees

Functions and fractals: Sierpinski triangle

Graham Scan - find points of a convex hull from a series of coordinates

Super digit

Link to this section Types

Link to this type

sequences()
sequences() :: [tuple()]

Link to this type

solution()
solution() :: [{char(), tuple()}]

Link to this section Functions

Link to this function

convex_hull_perimeter(points)
convex_hull_perimeter([tuple()]) :: number()

Convex hull

https://www.hackerrank.com/challenges/convex-hull-fp/problem

Find the perimeter of a convex hull from a series of coordinates, opted to implement Graham's scan algorithm. https://en.wikipedia.org/wiki/Graham_scan

Link to this function

cross_words(grid, words)
cross_words(list(), list()) :: list()

Crosswords-101

https://www.hackerrank.com/challenges/crosswords-101/problem

Link to this function

draw_trees(iterations)
draw_trees(integer()) :: list()

Functions and Fractals - Recursive Trees

https://www.hackerrank.com/challenges/fractal-trees/problem

Link to this function

draw_triangles(iterations)
draw_triangles(integer()) :: list()

Functions and fractals: Sierpinski triangle

https://www.hackerrank.com/challenges/functions-and-fractals-sierpinski-triangles/proble

Link to this function

graham_scan(points)
graham_scan([tuple()]) :: [tuple()]

Graham Scan - find points of a convex hull from a series of coordinates

See https://en.wikipedia.org/wiki/Graham_scan

For https://www.hackerrank.com/challenges/convex-hull-fp/problem

Link to this function

super_digit(n, k)
super_digit(integer(), integer()) :: integer()

Super digit

https://www.hackerrank.com/challenges/super-digit/problem