Grigory Hatsevich (2018-03-18T07:56:12.000Z)
g.hatsevich at gmail.com (2018-03-18T15:04:18.745Z)
"This would remove the challenge and actively worsen their learning process" -- this is not true. You can see it e.g. by looking at the specific task I was talking about: "Given a string, find the shortest possible string which can be achieved by adding characters to the end of initial string to make it a palindrome." This is my code for this task: function buildPalindrome(s){ String.prototype.reverse=function(){ return this.split('').reverse().join('') } function isPalindrome(s){ return s===s.reverse() } for (i=0;i<s.length;i++){ first=s.slice(0,i); rest=s.slice(i); if(isPalindrome(rest)){ return s+first.reverse() } } } As you see, the essence of this challenge is not in the process of reversing a string. Having a reverse() method just makes the code more readable -- comparing to alternative when one would have to write .split('').reverse().join('') each time instead of just .reverse()
g.hatsevich at gmail.com (2018-03-18T15:03:26.043Z)
"This would remove the challenge and actively worsen their learning process" -- this is not true. You can see it e.g. by looking at the specific task I was talking about: "Given a string, find the shortest possible string which can be achieved by adding characters to the end of initial string to make it a palindrome." This is my code for this task: function buildPalindrome(s){ String.prototype.reverse=function(){ return this.split('').reverse().join('') } function isPalindrome(s){ return s===s.reverse() } for (i=0;i<s.length;i++){ first=s.slice(0,i); rest=s.slice(i); if(isPalindrome(rest)){ return s+first.reverse() } } } As you see, the essence of this challenge is not in the process of reversing a string. Having a reverse() method just makes the code more readable -- comparing to alternative when one would have to write .split('').reverse().join('') each time instead of just .reverse()
g.hatsevich at gmail.com (2018-03-18T15:02:59.148Z)
"This would remove the challenge and actively worsen their learning process" -- this is not true. You can see it e.g. by looking at the specific task I was talking about: "Given a string, find the shortest possible string which can be achieved by adding characters to the end of initial string to make it a palindrome." This is my code for this task: function buildPalindrome(s){ String.prototype.reverse=function(){ return this.split('').reverse().join('') } function isPalindrome(s){ return s===s.reverse() } for (i=0;i<s.length;i++){ first=s.slice(0,i); rest=s.slice(i); if(isPalindrome(rest)){ return s+first.reverse() } } } As you see, the essence of this challenge is not in the process of reversing a string. Having a reverse() method just makes the code more readable -- comparing to alternative when one would have to write .split('').reverse().join('') each time instead of just .reverse()