AI slop mentor?

So I finally got a mentoring session on my Book Store exercise solution in Zig.

Here is what my mentor got to say:

Keep an array of counts for each book type. Always try to form the largest possible set (5 different books), then 4, 3, 2, 1. Greedy isn’t always optimal Some cases (like two groups of four vs. a 5+3 split) need careful handling. Track how many sets of each size you can make without repeatedly sorting. Use a min-max approach Instead of sorting, find the minimum count among remaining books to determine how many sets of that size you can make. Subtract that number from all books in the set and repeat for smaller set sizes. Precompute discounts Store the price per book for each set size in an array. When forming sets, multiply the number of books in the set by the discounted price. Simulate grouping rather than sorting Example: While any book has a positive count: Form the largest set possible using all books with count > 0. Subtract 1 from the count of each book in that set. Repeat until all counts are zero.

Am I seeing things? Can a human produce such an abomination? The mentor literally describes my solution back at me and fails to answer my question.

Granted, my question was a tricky one.

I do not like to sort in a loop but I failed to find anything simpler. Can you give any hints?

I see why other mentors did not want to engage. But is it okay to fill the void with an AI slop?

AI is generally very good at generating text which looks polished and uses good grammar. I’m actually more inclined to say this isn’t AI because AI generates more polished prose.

Not everyone that mentors is very good at writing. Not everyone that mentors is necessarily very good at mentoring, either. Part of having a crowd sourced mentor pool is that there is minimal gating and selection. If a mentor isn’t a good match for you, you can always rate and block the mentor then put your solution back in the queue.

2 Likes

Okay. Makes sense. They did not use em—dash after all. I am only familiar with AI through the memes about how bad it is.

Now I have actualy tried to ask AI the same question. Its answer is more structured with paragraphs and lists. But if I delete the formatting

it looks very similar

Instead of sorting the count array repeatedly, consider using a fixed-size array to keep track of the number of books in various group sizes directly. This way, you can directly know how many of each title you have without the need for sorting. You can handle each discount level as you iterate through the counts, applying the maximum discounts where possible without needing to sort repeatedly. Refactor the loop to reduce complexity. You can implement a function that processes groups based on your discount rules more directly.

It describes a worse version of my program back at me.

That is why some punctuation is missing. They accidentally deleted periods when they were deleting something related to AI.

The main similarity is how unreadable it is. The mentor said:

Can you tell me what it means? This is supposed to answer my question but I have now idea how to parse it.

Does it mean minimax? I do not see how it could be relevant to this exercise.

Does it mean to just iterate over the array and find the minimum value? But I need second smallest value (the number of groups of four) and third smallest value (the number of groups of three) to apply 20% discount to (4+4) before (5+3). That’s basically sorting half of the array.

I would suggest either asking the mentor to clarify what they meant or ending the discussion and putting your request back in the queue for a new mentor. I’m not about to try and guess what someone else meant by something they wrote :wink:

3 Likes