From 50279f78bcf455f3ac9492fed149a353262bbe77 Mon Sep 17 00:00:00 2001 From: github-actions <${GITHUB_ACTOR}@users.noreply.github.com> Date: Sun, 4 Jul 2021 03:09:32 +0000 Subject: [PATCH] clang-format and clang-tidy fixes for cdf701c2 --- dynamic_programming/house_robber.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dynamic_programming/house_robber.cpp b/dynamic_programming/house_robber.cpp index 6ef313e59..92af4d2ce 100644 --- a/dynamic_programming/house_robber.cpp +++ b/dynamic_programming/house_robber.cpp @@ -34,14 +34,15 @@ std::uint64_t houseRobber(const std::vector &money, int n) { if (n == 1) { // if there is only one house return money[0]; } - if (n == 2) { // if there are two houses, one with the maximum amount of money will be robbed - return std::max(money[0],money[1]); + if (n == 2) { // if there are two houses, one with the maximum amount of + // money will be robbed + return std::max(money[0], money[1]); } int max_value = 0; // contains maximum stolen value at the end int value1 = money[0]; - int value2 = std::max(money[0],money[1]); + int value2 = std::max(money[0], money[1]); for (int i = 2; i < n; i++) { - max_value = std::max(money[i]+value1,value2); + max_value = std::max(money[i] + value1, value2); value1 = value2; value2 = max_value; }