Add solution based on constexpr