Interpolating between things using lerp
.
function lerp (start, end, t) {
return start * (1 - t) + end * t;
}
For an instance, forget that arrays and strings exists. Your challenge, is to say if a number is a palindrome or not using mostly mathematical approach.
The string you will receive (because it is an user input), it always positive. You can assume that every 0 <= n < 10
is a palindrome.
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
{"columns":["n","m"],"data":[{"row":[{"geo":[-118.659776,34.127826],"followers":39046765,"screen_name":"KimKardashian","twitter_id":25365536},{"geo":[-118.668404,33.704538],"followers":240492,"screen_name":"BrittGastineau","twitter_id":25158003}],"graph":{"nodes":[{"id":"0","labels":[],"properties":{"geo":[-118.659776,34.127826],"followers":39046765,"screen_name":"KimKardashian","twitter_id":25365536}},{"id":"2","labels":[],"properties":{"geo":[-118.668404,33.704538],"followers":240492,"screen_name":"BrittGastineau","twitter_id":25158003}}],"relationships":[]}},{"row":[{"geo":[-118.659776,34.127826],"followers":39046765,"screen_name":"KimKardashian","twitter_id":25365536},{"geo":[-71.9443666,41.03455682],"followers":218786,"screen_name":"SimonHuck","twitter_id":40667680}],"graph":{"nodes":[{"id":"0","labels":[],"properties":{"geo":[-118.659776,34.127826],"followers":39046765,"screen_name":"KimKardashian","twitter_id":25365536}},{"id":"1","labels":[],"properties":{"geo":[-71.9443666,41.03455682],"followers":21 |