42i 2 code challenges
Given two arrays of integers, compute the pair of values (one value in each array) with the smallest (non-negative) difference. Return the difference.
I made this challenge in java
challenge1.java
Given an array of positive integers representing the values of coins in your possession, write a function that returns the minimum amount of change (the minimum sum of money) that you cannot create. The given coins can have any positive integer value and aren’t necessarily unique (i.e., you can have multiple coins of the same value).
For example, if you’re given coins = [1, 2, 5]
, the minimum amount of change that you can’t create is 4
. If you’re given no coins, the minimum amount of change that you can’t create is 1.
I made this challenge in javascript
challenge2.js