This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Find the minimum number of coins required to make n cents. | |
* You can use standard American denominations, that is, 1¢, 5¢, 10¢, and 25¢. | |
* For example, given n = 16, return 3 since we can make it with a 10¢, a 5¢, and a 1¢. | |
* https://pl.kotl.in/Nw2rJRzC5 | |
*/ | |
fun main() { | |
print(calculateCoins(16, listOf(1, 5, 10, 25))) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Given the root to a binary search tree, find the second largest node in the tree. | |
// https://dotnetfiddle.net/ZLdVSy | |
class Program | |
{ | |
public class Node | |
{ | |
public int Value { get; private set; } | |
public Node Left { get; private set; } | |
public Node Right { get; private set; } |