Advertisement
Guest User

Untitled

a guest
Dec 6th, 2022
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. int part_two() {
  2.     std::ifstream reader("data.txt");
  3.     for (auto [i, x] : std::views::zip(std::views::iota(0),              
  4.         std::views::transform(std::views::slide(std::string{std::istreambuf_iterator<char>(reader),
  5.             std::istreambuf_iterator<char>()}, 14), [](auto&& x) {
  6.                 return std::unordered_set(x.begin(), x.end());
  7.             })
  8.     )) if (x.size() == 14) return i + 14;
  9.  
  10.     return -1;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement