Problem finding maximum element index -- How do I do this? #927
Unanswered
infinite-pursuits
asked this question in
Q&A
Replies: 1 comment
-
You could provide maximum value using a hint, compare this value against all values inside the slice to be less equal than the maximum value ( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a circuit with the following piece of code:
This gives me the error
constraint #3812 is not satisfied: -1 ⋅ 2 != 0
, possibly because I use api.Cmp (can be 0,1, or -1) inside of api.Select which expects 0 or 1 only.The functionality I want is just to find the index of the maximum element in a 2 element list. Is there an alternate way to implement this without encountering the error?
Beta Was this translation helpful? Give feedback.
All reactions