To get credit, something must be made to work. Partial credit will be determined by when your function works. Emphasis in the grading will be on clarity of presentation, success in meeting the design objectives, and quality and cleverness in the design. The work load in this course is far from trivial. In the design and development work, many find themselves being frustrated by errors.
Prevention is always the best medicine.
It gives you an explicit set of steps which take you from the input data to the data to be returned. By programming the computer to do those steps, you can solve the problem. It provides one working example with intermediate results which can be used to step through the program in the debugger to pick up programming bugs. Often, that hand example is enough, but sometimes you run into brick walls. Do not sit there and suffer or give up.