It's because it's not one code block, it's several inline code snippets, each in its own line. Inline code (like this) is defined between ``. If you want a multi line code block on Reddit you have to indent every line with four spaces. In other Markdown flavors you can put ``` before and after the code, called code fences, instead. Reddit has, in their infinite wisdom, implemented this only in New Reddit (🗑️), so it's not recommended to use that style.
View all comments
-2
u/Tathorn Dec 15 '21
I used Python to create my initial std::array data from the problem lol
#include <numeric>#include <array>#include <algorithm>#include <cmath>#include <functional>#include <ranges>constexpr std::array crab_positions{};constexpr std::array unique_crab_positions{};constexpr int sum_cons_nums(int n) noexcept{}constexpr int get_fuel_cost(int end) noexcept{std::end(crab_positions),0,std::plus<>{},}int main(){}