If x=[0,3,4,2,1] then y=[4,3,2,1,0]
it is a good problem,but I cann't solve it
Only one verification test!? and this test already has the vector sorted.
li look up the options of the sort command
Needs (much) more tests in the Test Suite!! It would also be a good idea to include a randomly generated vector in the tests; for this random input, testing of the correct function output should be hard-coded as: assert(y(1)>=y(2)); assert(y(2)>=y(3)); ... ; assert(y(end-1)>=y(end)); [It's not the most efficient check, but anything else will risk giving away clues on possible solution codes.]
i comment for the challenge
wow
This user appears to have gamed the system, with fraudulent "likes" of this unremarkable solution submitted by 'sock-puppet' accounts. —DIV
This user (ALBERT ALEXANDER STONIER) appears to have gamed the system, with fraudulent "likes" of this unremarkable solution submitted by 'sock-puppet' accounts. —DIV
Every time again, it's pretty amazing, to see what powerfull little functions are implemented in Matlab!
You can do this with one function call. See the mode flag in sort().
:p
Find the alphabetic word product
1997 Solvers
Number of 1s in a binary string
1230 Solvers
251 Solvers
171 Solvers
241 Solvers