Make a vector of length N that consists of all zeros except at index k, where it has the value 1.
Example:
Input
N = 6; k = 2; vector = one_hot(N,k);
Output
vector = [0 1 0 0 0 0]
Good Problem
funny
Any reason why the problem template gives away half of the solution?
173 Solvers
1316 Solvers
Test if two numbers have the same digits
154 Solvers
261 Solvers
261 Solvers