Skip to content

Instantly share code, notes, and snippets.

@renanreismartins
renanreismartins / BestSum.scala
Created March 2, 2023 11:19
needs memoization
object BestSum extends App {
def bestSum(n: Int, coins: Array[Int]): Array[Int] = {
if (n == 0) return Array[Int]()
if (n < 0) return null
var shortest: Array[Int] = null;
for (coin <- coins) {
@renanreismartins
renanreismartins / configure_personal_professional_git_account.txt
Last active November 22, 2023 18:12
Configure personal and professional git
~ cat .gitconfig-personal
[user]
signingkey = XXXXXXXXXX
name = Renan Reis Martins de Paula
email = renanreismartins@gmail.com
[core]
sshCommand = "ssh -i ~/.ssh/id_rsa_personal"
public class OrderCreationController {
private final OrderRepository orderRepository;
private final ProductCatalog productCatalog;
public OrderCreationController(OrderRepository orderRepository, ProductCatalog productCatalog) {
this.orderRepository = orderRepository;
this.productCatalog = productCatalog;
}
public Response post(List<Item> requests) {