Im a little bummed when i solve an FCC challenge because when I check other solutions I always find neater and shorter code used to do just the same thing i’ve done.
Is it simply experience or i’m not trying hard enough? How do you achieve the same things with less code?
I think it is the experience in writing
If you do a long code try to use For loop or While loop , use more If Else , for the neater code just there is some rules to make stuff looks better like
hope somebody reply for you too as i also need to know more
It’s on my list.
It’s simply experience. And a lot of that experience will just be knowing where and how to look more efficiently for new ideas. After discovering FCC I realize that I have a bazillion things to learn myself.
It’s being aware that there are X and Y commands you can use, and this only comes from
a. being exposed and reading other people’s code and learning from it.
b. reading the language reference manual/documentation in your spare time to become familiar what X and Y commands are available.