Skip to content

Latest commit

 

History

History
15 lines (7 loc) · 343 Bytes

README.md

File metadata and controls

15 lines (7 loc) · 343 Bytes

Good morning! Here's your coding interview problem for today.

This problem was asked by Squarespace.

Write a function, add_subtract, which alternately adds and subtracts curried arguments. Here are some sample operations:

add_subtract(7) -> 7

add_subtract(1)(2)(3) -> 1 + 2 - 3 -> 0

add_subtract(-5)(10)(3)(9) -> -5 + 10 - 3 + 9 -> 11