« first day    last day (88 days later) » 

6:53 AM
Hi
thanks
I ll update from the old chat room
So far, we have:
that's failing TC3
this one failing TC7
map<string, size_t> getAllSubstrings(string const& s)
{
	map<string, size_t> map;

	for (size_t i = 1; i <= s.length(); ++i)
	{
		for (size_t j = 0; j <= s.length() - i; j++)
		{
			auto sub = s.substr(j, i);
			++map[sub];
		}
	}
	return map;
}
And this:
s1.length() * s1.length() / 2 + s2.length() * s2.length() / 2
another variant:
n * (n + 1) / 2 <= n*n, n >= 1

sqrt((n*n + m*m) / 2) < max(n, m)
sqrt(count)/(n + m - sqrt(count))
and this:
 sqrt(2)*n/(2*n-sqrt(2)*n) = sqrt(2)/(2-sqrt(2))
= sqrt(2)*(2+sqrt(2))/((2-sqrt(2)*(2+sqrt(2)))
= (2*sqrt(2) + 2)/(4-2)
= sqrt(2) + 1
~ 2,414
 
7:30 AM
and we'd have for count: (n * (n+1) / 2) * 2,
 
7:55 AM
We have that for count in maximum case. It's for proving that we can count all common occurences of substrings, calculate square root of and use that result for calculating Jaccard index: sqrt(count)/(s1.length() + s2.length() - sqrt(count)).
That's for being closer to task, where they use the simple sum of both tasks...
 
8:12 AM
Not tasks, lengths of course...
 
 
9 hours later…
4:57 PM
I see
Now, how the program would be structured
?
 

« first day    last day (88 days later) »