Skip to main content

Questions tagged [function]

For challenges that ask for a function or involve functions in some way. (Also known as methods or subroutines.)

12 votes
6 answers
3k views

Your challenge today is to implement a t9-like functionality. You will implement a function that will only have 2 parameters. You will receive 1 phone number in a string and the content of a text ...
Ismael Miguel's user avatar
29 votes
13 answers
6k views

Terms A worm is any list of nonnegative integers, and its rightmost (i.e., last) element is called the head. If the head is not 0, the worm has an active segment consisting of the longest contiguous ...
r.e.s.'s user avatar
  • 3,162
80 votes
78 answers
17k views

Inspired by a now deleted StackOverflow question. Can you come up with a way to get a particular method executed, without explicitly calling it? The more indirect it is, the better. Here's what I ...
user avatar
29 votes
13 answers
2k views

Write a function that contains five lines. If you run the function as-is, it should return 0. If you remove any one of the five lines and run the function, it should tell you which of the lines has ...
jawns317's user avatar
  • 1,182
19 votes
62 answers
6k views

I honestly can't believe this challenge does not already exist. The challenge Write a function. The specifics Your program must define some sort of callable function. This includes anything ...
moltarze's user avatar
  • 2,578
18 votes
24 answers
8k views

Create a function in your chosen language that prints out the following: ...
rybo111's user avatar
  • 4,585