Facebook | Phone | Target Sum
Anonymous User
5533

I had a phone interview with Facebook today and the question asked was

Given a String and a target find the number of possibilities the target can be formed using all the digits in the string (same order, used only once) using only + and - operations.

Example: Given "13" and 2
return 1
because -1+3 = 2

Answered it using recursion but took 35 mins to come to the final answer. We didn't have time to go the next question.

EDIT: Got a rejection.

Comments (19)