MCPcopy Create free account
hub / github.com/codereport/Content / dangerous_team

Function dangerous_team

Talks/2019-05-CppNow/AlgorithmIntuition/Slide-160.cpp:1–10  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1auto dangerous_team(string const& s) -> bool {
2   return adjacent_reduce(cbegin(s), cend(s),
3      make_pair(1, 1),
4      [](pair<int, int> acc, bool equal) {
5         auto [max_player, curr_player] = acc;
6         curr_player = equal ? ++curr_player : 1;
7         return make_pair(max(max_player, curr_player), curr_player);
8      },
9      std::equal_to{}).first >= 7;
10}

Callers

nothing calls this directly

Calls 1

adjacent_reduceFunction · 0.85

Tested by

no test coverage detected