A Pen by Omar De Leo on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const loadedFunc = () => { | |
| console.log("aayyy"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .sort((a, b) => { | |
| let aLanguage, aProficiency, bLanguage, bProficiency; | |
| const aLanguages = a[0].get("Please list what other languages you speak, if any, and level of fluency. ") | |
| const bLanguages = b[0].get("Please list what other languages you speak, if any, and level of fluency. ") | |
| // console.log(aLanguages) | |
| // console.log(bLanguages) | |
| if (aLanguages) { | |
| for (let language of aLanguages) { | |
| const [lang, prof] = language.split(" - "); |
A Pen by Omar De Leo on CodePen.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param {string[]} strs | |
| * @return {string} | |
| */ | |
| var longestCommonPrefix = function(strs) { | |
| // create prefix string | |
| // assign first letter of first word to a variable | |
| // check if every word contains it | |
| // if it does, add letter to prefix string | |
| // repeat until false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var romanToInt = function(s) { | |
| const legend = { | |
| I: 1, | |
| V: 5, | |
| X: 10, | |
| L: 50, | |
| C: 100, | |
| D: 500, | |
| M: 1000 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var isPalindrome = function(x) { | |
| if (x < 0) return false; | |
| if (x < 10) return true; | |
| if (x % 10 === 0) return false; | |
| let abs = Math.abs(x); | |
| return String(abs) === String(abs).split('').reverse('').join(''); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var reverse = function(x) { | |
| const rev = Math.abs(x).toString().split("").reverse("").join(""); | |
| if (rev > 2**31) return 0; | |
| return rev * Math.sign(x); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param {number[]} nums1 | |
| * @param {number[]} nums2 | |
| * @return {number} | |
| */ | |
| var findMedianSortedArrays = function(nums1, nums2) { | |
| let count = 0; | |
| let resArr = []; | |
| while (nums1.length > 0 && nums2.length > 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @param {string} s | |
| * @return {number} | |
| */ | |
| var lengthOfLongestSubstring = function(s) { | |
| let a_pointer = 0; | |
| let b_pointer = 0; | |
| let max = 0; | |
| let charObj = {}; | |
| while (b_pointer < s.length) { |
NewerOlder