I don't know where you got this exercise from, but your example code appears to showcase the difference between mutating a variable and shadowing one.
See this chapter of The Book:
I would advise against using AI to solve problems for you when you are learning Rust. Or anything else for that matter. However, as you are there, did you ask said AI to explain what that code is demonstrating? I did, it has interesting response.
For me, I like shadowing when I have some data in some type and I convert it into essentially the same data in a different type. For example getting a number input from a user as a String and converting it to integer of float. Using shadowing for the converted value saves me having to dream up a different name for it.