← Back to challenges

Secret Function

JavaScriptHardlogiclanguage_fundamentalsnumbersmath

Instructions

Create a function based on the input and output. Look at the examples, there is a pattern.

Examples

secret(24) ➞ 8

secret(42) ➞ 8

secret(15) ➞ -4

secret(52) ➞ 15

Notes

  • num >= 10 and num <= 52
  • Math.pow, * and - can be helpful.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.