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.
The problem says only addition and multiplicaiton are allowed. And the example includes combinations with neither operator ("1", and "2").
The examples also illustrate the combinations where none of one or the other value is present (e.g. "1+1", "2x2").
But what about a combination with neither value (i.e. the empty set), like neither operation? I don't see anything that would preclude this. It may be arguable whether this combination represents a sum of 0 or an undefined sum, but it would seem to be one of the possibilities, given the problem description. Am I missing something?
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Ones and Twos
You are viewing a single comment's thread. Return to all comments →
The problem says only addition and multiplicaiton are allowed. And the example includes combinations with neither operator ("1", and "2"). The examples also illustrate the combinations where none of one or the other value is present (e.g. "1+1", "2x2"). But what about a combination with neither value (i.e. the empty set), like neither operation? I don't see anything that would preclude this. It may be arguable whether this combination represents a sum of 0 or an undefined sum, but it would seem to be one of the possibilities, given the problem description. Am I missing something?