This piece of code does not work.
match ugly[i] {
ugly[t2]*2 => t2+=1,
ugly[t3]*3 => t3+=1,
ugly[t5]*5 => t5+=1,
_ => panic("no possible")
}
^ expected one of `=>`, `@`, `if`, or `|`
What I want is:
if ugly[i]==ugly[t2]*2 {
t2+=1;
} else if ugly[i]==ugly[t3]*3 {
t3+=1
} else {
t5+=1
}
Can I do the same thing with match?