We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
After the preceding set of questions which called for solutions done in the mind or the desk of the respondent, I couldn't imagine how we were supposed to programmatically identify a valid function. So here's a blatant cheat which depends on the relationship between the first 2 numbers and the expected results:
Of course, this "solution" will fail if the questions change.
Other discussions on this topic explain that the intended solution would check whether each function input consistently had only one or always the same output. But other people have already done a good job on that!
Functions or Not?
You are viewing a single comment's thread. Return to all comments →
After the preceding set of questions which called for solutions done in the mind or the desk of the respondent, I couldn't imagine how we were supposed to programmatically identify a valid function. So here's a blatant cheat which depends on the relationship between the first 2 numbers and the expected results:
Of course, this "solution" will fail if the questions change.
Other discussions on this topic explain that the intended solution would check whether each function input consistently had only one or always the same output. But other people have already done a good job on that!