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?
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?
best sports betting ?
Here is my solution in java, javascript, python, C, C++, Csharp HackerRank Ones and Twos Problem Solution
Here is Ones and Twos problem solution in Python Java C++ and C programming - https://programs.programmingoneonone.com/2021/07/hackerrank-ones-and-twos-problem-solution.html
But how?! I wrote algorithm with complexity O(n) with memory O(1) but why is that not enough? "Terminated due to timeout :("