Skip to content

Instantly share code, notes, and snippets.

View ariesabao's full-sized avatar
🎯
Focusing

ariesabao

🎯
Focusing
  • Philippines
View GitHub Profile
@ariesabao
ariesabao / palindromechecker.js
Created August 8, 2018 16:40
JavaScript Algorithms and Data Structures Projects
function palindrome(str) {
str = str.toLowerCase().replace(/[\W_]/g, '');
for(var i = 0, len = str.length - 1; i < len/2; i++) {
if(str[i] !== str[len-i]) {
return false;
}
}
return true;
}
@ariesabao
ariesabao / codewars.py
Created May 7, 2018 22:29
Codewars | Sum of two lowest positive integers
"""Create a function that returns the sum of the two lowest positive numbers
given an array of minimum 4 integers. No floats or empty arrays will be
passed.
For example, when an array is passed like [19, 5, 42, 2, 77],
the output should be 7.
[10, 343445353, 3453445, 3453545353453] should return 3453455.
Hint: Do not modify the original array. """