diff --git a/day5/Makefile b/day5/Makefile index 916baa1..6b95bcb 100644 --- a/day5/Makefile +++ b/day5/Makefile @@ -1,7 +1,7 @@ CC=g++ BIN_NAME=day5 CCFLAGS=-o $(BIN_NAME) -g -LDFLAGS=-lfolly -std=c++17 +LDFLAGS=-std=c++17 .PHONY: all, clean diff --git a/day5/day5.cpp b/day5/day5.cpp index 78f2002..1409793 100644 --- a/day5/day5.cpp +++ b/day5/day5.cpp @@ -36,17 +36,12 @@ std::vector read_input(const std::string &filename) { int getPosFromSpec(std::string_view spec, char bottomHalfChar, char topHalfChar, int initMax) { int max = initMax; int min = 0; - int stringCursor = 0; for (char candidate : spec) { - // std::cout << min << " " << max << std::endl; - // std::cout << candidate << std::endl; if (candidate == topHalfChar) { max = (max + min) / 2; } else if (candidate == bottomHalfChar) { min += (max - min) / 2 + 1; } - - stringCursor++; } return min;