Better use std::set instead of std::map
Look a bit like waste of memroy.
Pro number 1 : auto uses type deduction which simplifies life considerably.
Pro number 2: auto forces you to initialize a variable hence you can’t forget doing that. Statement “auto x” is illegal.
Pr0 number 3: If you change datatypes afterwards (eg int to float), you need to change it less times
Con: Referring to pro number 1 “Our virtues and our failings are inseparable” :) auto may deduce type incorrectly, but luckily it’s hard to trick it. One such case is
See also: https://stackoverflow.com/questions/6434971/how-much-is-too-much-with-c11-auto-keyword https://stackoverflow.com/questions/6900459/the-new-keyword-auto-when-should-it-be-used-to-declare-a-variable-type
but what's the advantage of using "auto"??
Thanks for the explanation DarkD1 👍
and sometimes c++ gives up(std::vector <auto>)
It tells C++ to try and automatically detect the type.
Hey man! What does "auto" do??
At least give one example on how flipping occurs, for example in the given example: "0011001100", [I, 1, 10] 7th bit is 1 when I would flip that it would be 0 but answer expects me 1.
"0011001100", [I, 1, 10]
Nice and clean
This comment is hidden because it contains spoiler information about the solution
Thank you very much. Sorry for the late reply, the notification didn't light up as normal.
Performance challenges really force you to dig deep, brilliant kata!
Triangular numbers and algebra