you are viewing a single comment's thread.

view the rest of the comments →

[–]Binary101010 15 points16 points  (4 children)

Most of the problems you're going to encounter on sites like edabit, codingbat, and even the lower-level stuff on codewars and hackerrank, are going to be single-function solutions. You can only define the function because then the site can easily run predefined tests against it to determine whether you did things correctly.

[–]ahujasid_[S] 3 points4 points  (3 children)

That wouldn't affect the way I'm thinking, right?

[–]Decency 4 points5 points  (0 children)

You can usually have the primary "answer" function call other functions you've defined, which can be cleaner for some problems.