Thanks, found it https://github.com/tokio-rs/axum/blob/main/examples/form/src/main.rs
Yeah, I just had to pass numbers
by value instead of reference.
Thank you for the suggestion, I will update the code locally :)
This is very unneccessary for a simple pastebin clone.
It might be but as I said I am very new to Rust and don't know how to do some stuff in Rust. someone on IRC said I should use Arc to get around this issue but I didn't know much about Arc so I went with unsafe.
I use tilde.club to host my website and gemini capsule. It's awersome I don't have to think about managing the server since it's done by the staff of tilde.club
It's because I am changing the value of a static variable, there could be more than one thread trying to change the value of FILE_COUNT which could lead to race condition.
Can you share which software you are talking about?
I’m going to assume that Python keeps multiple versions of the array in memory
yeah you are right, I am passing the vector of numbers by reference, that's why my solution doesn't work.
Thanks I will try to run the python version and see if it works. I think the problem is that I am passing list of numbers by reference and in python it's passed by value, this is the reason the python version works while mine doesn't.
wow, that's a nice idea. I will try to solve this problem with this method if mine doesn't work.
last input isn't working, for the last input answer should be true but I am getting false. here is the output:
rustc t1.rs && ./t1
190
[10, 19]
> 190 true
it's true
3267
[81, 40, 27]
> 87480 false
> 3267 true
it's true
83
[17, 5]
> 85 false
> 22 false
156
[15, 6]
> 90 false
> 21 false
7290
[6, 8, 6, 15]
> 4320 false
> 303 false
> 54 false
> 14 false
161011
[16, 10, 13]
> 2080 false
> 173 false
> 26 false
192
[17, 8, 14]
> 1904 false
> 150 false
> 25 false
21037
[9, 7, 18, 13]
> 14742 false
> 1147 false
> 81 false
> 16 false
292
[11, 6, 16, 20]
> 21120 false
> 1076 false
> 82 false
> 17 false
yeah, you are right, I don't need
mut
. here is the improved version: