# ChatGPT gets buckbroken by a basic optimization problem and suggests a default function.

ChatGPT gets buckbroken by a basic optimization problem and suggests a default function.
Are YOU better than chatgpt, BOT?

1. 2 months ago
Anonymous

>>> 'reggin'[::-1]

2. 2 months ago
Anonymous

fuck off boomie i'm going to use the algorithims in the standard libarary. no i'm not going to write my own and no i'm not going to feel inferior for that. nobody cares about you CS prof larp, the std lib algos are faster than the textbook theory shit you vomit

• 2 months ago
Anonymous

>CS
It's over before it even began for you kek

3. 2 months ago
Anonymous

if 'a', push back 'a'
else, push back ch[no]

?

• 2 months ago
Anonymous

Too slow, sorry. Imagine a string of million characters, do you unironically go through every single character just to see whether you need to change it to an a?

• 2 months ago
Anonymous

Default to 'a'
if a do nothing
else insert ch[no]
?

• 2 months ago
Anonymous

Hint: use statistics. You literally know that 9/10 times the character will be an "a", and you do nothing with this information.

• 2 months ago
Anonymous

I'm guessing there's more to it than just stopping once you found 10% the string-length of non-a's, but just that should be faster most of times, right?

• 2 months ago
Anonymous

If you know nothing about the distribution it really doesn’t help. I guess you could do something like after finding a non-a you skip the next 5% of the string, but you’ll likely miss one and have to repeat the process anyways.

Hint 2: work with the assumption that there's only one a in a gigantic string that you need to reverse. Now extrapolate it to 2 A's, 10 A's, 1% A's and so on...

• 2 months ago
Anonymous

does it matter? you can put the length of several strings together and calculate 10% of that as well, or just make it a loop. But why would you look at the A's rather than the rest? length-check is included in reversed() so there's no reason to not use it rather than counting A's, or is that part of what is poorly optimized about it?

• 2 months ago
Anonymous

If you know nothing about the distribution it really doesn’t help. I guess you could do something like after finding a non-a you skip the next 5% of the string, but you’ll likely miss one and have to repeat the process anyways.

• 2 months ago
Anonymous

Hint: use statistics. You literally know that 9/10 times the character will be an "a", and you do nothing with this information.

[...]
Hint 2: work with the assumption that there's only one a in a gigantic string that you need to reverse. Now extrapolate it to 2 A's, 10 A's, 1% A's and so on...

Nice troll. The output complexity is linear. You will have a hard time going faster.

4. 2 months ago
Anonymous

>Are YOU better
I don't think so, because what I'd do is load, vpshufb, store. Assuming non-Unicode, anyway. I don't see how you could be faster than that regardless of what the string contains. What did you have in mind?

5. 2 months ago
Anonymous

>561 KB
WTF is wrong with you? KYS.

6. 2 months ago
Anonymous

All you need is a mirror.

7. 2 months ago
Anonymous

?t=175

And the people bowed and prayed
To the neon god they made
And the sign flashed out its warning
In the words that it was forming
And the sign said, "The words of the prophets are written on the subway walls and tenement halls
And whispered in the sound of silence"

The word of the prophets are the schizos

• 2 months ago
Anonymous

the sign = the profile pic

>He will not shout or cry out, or raise his voice in the streets. A bruised reed he will not break, and a smoldering wick he will not snuff out. In faithfulness he will bring forth justice;

8. 2 months ago
Anonymous