Ad
  • Custom User Avatar

    I'm 100% in agreement with your logic, and the description should definitely be updated with some clarification. Here's how I would describe the circuit.

    • The circuit has an internal state that is determined by the sequences of button inputs. This state is either OFF, RED, or BLUE.
    • When the circuit changes into either the RED or BLUE state from a previous, different state, the corresponding red or blue LED will blink once.
    • When no buttons are currently being pressed, the circuit is in the OFF state (the initial state of the circuit).
    • When a single button is being pressed, the circuit is in the state that matches the color of the button.
    • When the circuit is in the OFF state and both buttons are then pressed, the circuit switches to the RED state.
    • When the circuit is in either the RED or BLUE state and the matching button is held down, the circuit will remain in its current state.
  • Custom User Avatar
  • Custom User Avatar

    Quite simple and funny coding challenge to solve, well done.

  • Custom User Avatar

    ok letmedie sps paka

  • Custom User Avatar
  • Custom User Avatar

    python new test framework is required. updated in this fork

  • Custom User Avatar

    I'd say yes to both questions about the buttons.

  • Custom User Avatar

    Okay, but how do I see the response for the earlier one? It's hidden.

    Are the numbers transitional? That is if there's a "1010" then a 1 and the following 0, do they mean that the button was pressed and then released? So if there are 2 1s in succession like "110", then does that mean that the button is being held down?

  • Custom User Avatar

    No need to create a new issue about the same problem. Closing this one.

  • Custom User Avatar

    I can't read alexc19 answer, but I think the R is because of this other rule:

    If two buttons are pressed simultaneously, the red button will be preferred.

  • Custom User Avatar

    There are examples but without explanations. So it's difficult to make sense out of it with the explanation above it. I see another user has reported the same but I can't see the response for thta because it's hidden as it's marked as spoiler.

  • Custom User Avatar

    you have something like: [1, -1, 6, -6, 5]
    the reduce method give the number's sum, in this case it will be 5, and this is the correct answer.
    But there is a problem maybe you have something like [1, -1, 6, -6, 5, 5], in this case the sum will be 10, because we have an additional 5, to avoid that, he has removed all the duplicated numbers in the array converting it to Set type

  • Custom User Avatar
  • Custom User Avatar

    I wish I could set both "best practice" and "clever" together

  • Custom User Avatar
  • Loading more items...