I am currently solving leetcode question
Click here (Make sure that you open this in new tab, I tried by default redirect to new tab but didn’t figured out.)
Here is the link for your convience
https://leetcode.com/problems/rotate-array/description/
I came up with this solution which is giving me the answer
nums = nums.concat(nums.splice(0,nums.length - k));
On the console in browser the above code is working fine but I don’t why leetcode is not accepting this as a correct answer.
Please let me know your thoughts everyone. It really helps me to get better at understanding javascript as well as coding in platforms like leetcode.