day12

package
v0.0.0-...-36687a4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2020 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UniqueClimbs

func UniqueClimbs(steps int, strides []int) int

UniqueClimbs calculates the number of possible ways to climb the steps. Assumes that we have the given number of possible strides. A stride is the number of steps possible. Runs in exponential time.

func UniqueClimbsDS

func UniqueClimbsDS(steps int, strides []int) int

UniqueClimbsDS doesn't use recursion and instead iterates using memoization of subproblem results. Time complexity is O(K*N) where K is the number of possible strides and N is the number of steps.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL