0

Why the lines 295-317 are trying to modify the hash "bands"? That hash is supposed to stay frozen.

https://code.sololearn.com/c74y6d7k9g6z/?ref=app

22nd Jun 2019, 1:46 AM
Milo Draco
Milo Draco - avatar
3 Réponses
+ 1
The trick is in lines 145-146. cmodes = bands modald = bands When doing "bands.freeze" you're also freezing "cmodes" and "modald", hence the errors in lines 294-317 and 324-325 (which are not trying to modify "bands" but "cmodes" and "modald", respectively). To fix the errors change lines 145-146 to this. cmodes = bands.dup modald = bands.dup
22nd Jun 2019, 3:34 AM
Diego
Diego - avatar
+ 1
Thanks, bro!
22nd Jun 2019, 8:57 AM
Milo Draco
Milo Draco - avatar
0
Help, please.
22nd Jun 2019, 2:08 AM
Milo Draco
Milo Draco - avatar