Created a JS solution
You need to add two things in every pull request to get your pull request accepted apart from the program:
- Please add a thoughts section in your solution file where you outline the key steps followed in solving the problem.
- Update readme.md file to reflect the link of the solution for the language you've selected.
Thoughts section is missing in 'solution.js' file. Can you please add a small comment section at the top of the file where you outline the basic strategy followed while solving the problem?
I added the initial thoughts sections, but honestly felt a little bit awkward about describing the first problems like summing an array. Hopefully, it'll be useful to someone.
Thanks for adding the thoughts section @kevindelsh . I agree with you to a certain extent but it is all about having a consistent format of all the solutions that we keep in this repository. As the difficulty levels of the problems would grow, you would find this section very relevant.
Btw, I've one suggestion for you. Whenever you start working on a problem, always pen down your thoughts first either on a piece of paper or in the code file itself before you write first line of code.
The problem I've faced in the past is that when you write thoughts section after you've finished writing code then your thoughts section becomes more of a pseudo code section rather than your high level thoughts. Our thoughts section should reflect our initial vision of how would we approach/solve the problem when we looked at the problem with an empty mind. Writing code biases our mind's thought process as we get into detailed implementation which involves loops, if statement etc. I hope you'll find this suggestion useful.
Thank you for your feedback. Totally agree with you on the following points: 1- Need for consistency throughout the solutions. 2- The value of a high level analysis at the beginning of every problem-solving cycle 3- The pitfalls and fallacies of writing your "initial thoughts" after a challenge is complete.
The real value of writing down one's informal problem and solution, then formalize it and then tackling the problem in real code becomes evident as the problems rise in complexity.
Thanks for making this clear to me.
I learned all this from @RyanFehr . He is my real teacher and I owe this to him for all the teachings. I can't thank him enough for helping me learn this aspect of computer science.
Respect to both of you, @rasik210 & @RyanFehr