1,079 karma · joined August 5, 2019
For each char in the original string there is: * 1 check in hashmap (let's assume it was found). This is O(1) * build a new string where we remove that char from the string we are building (string2) and add it to the end. This step may look O(n) initially since we need to find that char in string2 but string2 is capped at 26 characters so it's O(1) * One comparison between the string we are building and the altered version.
How does that make it O(n^3)? I can't see which step inside the initial loop is O(n) or greater.
EDIT: The solution is actually incorrect so this is now semantics.
1) create an empty string, call it "S2" 2) loop over each char in original string 3) if the char isn't in S2, add it to the end of S2. If the char is already present in S2 then lexicographically compare the prior S2 verse S2 with this char shifted to the end. Keep the lower ordered one.
This took about 3-4 minutes of thinking and is O(n). It might not be optimal, it might not even be a correct solution as I've spent only a few minutes on it. However, I feel it's close and it wouldn't take much to flesh out.
EDIT: This solution is incorrect.
40% of Australia's population live in either Sydney or Melbourne, and these two cities are among the top 5 least affordable in the world [1].
1 - https://www.afr.com/companies/financial-services/australian-...
I served over 10 years in the military and it was a great decision for my life but I'm somewhat against conscription except in dire times.
Am I wrong for assuming that this article seems fairly low level for the user base here? It just seems to me that if you can read this article and understand push, pop, thread priority, mutex, transitive, etc then it's more than likely that someone has already lectured at you about the issues that can arrive with using mutexes for locking.
I'm curious if the rise of quantum computers will make the differences between exponential and combinatorial meaningful in a practical sense.
Within a couple of years of starting my CS degree, I was far better at programming than every hobbyist programmer I've met. I didn't have many opportunities out of school. I was from a poor country town that topped the state crime statistics. I know my mum hadn't finished high school and I don't think my father did either. I joined the military, got a trade and went to university at 30 as a single father working full time. University changed my life for the better, gave me a lot of tools and made me much more valuable.
"Twin studies of adult individuals have found a heritability of IQ between 57% and 73%[6] with the most recent studies showing heritability for IQ as high as 80%[7] and 86%.[8]. IQ goes from being weakly correlated with genetics, for children, to being strongly correlated with genetics for late teens and adults. "
EDIT: To clarify, the "local distributors" were a method to optimise local price points.
The human brain can model the physics of a ball in flight, accurately, and quickly. As the ball touches the finger tips it makes the smallest adjustments, again in tiny fractions of a second