interviewcake

package
v0.0.0-...-4d3ad75 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coins

func Coins(a int, denominations []int) [][]int

Coins is an algorithm problem from https://www.interviewcake.com/question/ruby/coin

Your quirky boss collects rare, old coins...

They found out you're a programmer and asked you to solve something they've been wondering for a long time.

Write a method that, given:

an amount of money an array of coin denominations computes the number of ways to make the amount of money with coins of the available denominations.

Example: for amount=4 (4¢) and denominations=[1,2,3] (11¢, 22¢ and 33¢), your program would output 44—the number of ways to make 44¢ with those denominations:

1¢, 1¢, 1¢, 1¢ 1¢, 1¢, 2¢ 1¢, 3¢ 2¢, 2¢

func GetMaxProfit

func GetMaxProfit(prices []int) int

func GetMaxProfitBruteForce

func GetMaxProfitBruteForce(prices []int) int

func GetMaxProfitOptimal

func GetMaxProfitOptimal(prices []int) int

func SortScores

func SortScores(arr []int, n int) []int

Types

type WordStats

type WordStats map[string]int

func Cloudify

func Cloudify(text string) WordStats

Jump to

Keyboard shortcuts

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