in the given code, the output should be -1 0 but the code gives 0 2. Please implement for k-dimention.