Can’t figure out where could I optimize this code.
Can you check if the code is correct and how can I optimize it?
Code - https://ide.codingblocks.com/s/412807