« first day (1699 days earlier)      last day (1137 days later) » 

3:42 AM
Does C++ have ?. operator to make sure the dereferenced pointer is not null?
 
 
10 hours later…
2:06 PM
Guys do you think forward declaration of a typedef good or bad practice?
 
2:59 PM
The beauty of a string is the difference in frequencies between the most frequent and least frequent characters.

For example, the beauty of "abaacc" is 3 - 1 = 2.

Given a string s, return the sum of beauty of all of its substrings.
I brute forced this but got tled, does anyone know a trick to speed this up?
 
3:10 PM
ive tried early termination of the subloop if len is 1
 
3:22 PM
1 message moved from Lounge<C++>
 
i thought that was my message then
 
Yes... don't randomly ping people
it's rude
 
sorry
 
 
4 hours later…
7:35 PM
@Trajan Impossible to guess, since you haven't told us anything about how you're doing it now (i.e., you haven't said what you mean by 'brute force").
If I were doing it, my first attempt would probably start with something like: std::vector<std::size_t> counts(std::numeric_limits<unsigned char>::max());.
 
@JerryCoffin I think you missed the "all substrings" part
 
@PeterT Oh, so I did.
 

« first day (1699 days earlier)      last day (1137 days later) »