Phone: (347) 742-6464
Email: [email protected]
LinkedIn: linkedin.com/in/ryan-omoruyi
GitHub: github.com/ryanomor
Technical: Java, Angular, Spring Boot, JavaScript, React, Redux, Node.js, RESTful API, AJAX, Git/GitHub, HTML, CSS, Express, SQL
| let str1 = '/a/b/../foo/.///'; | |
| let str2 = '/a/./b/../../c'; | |
| let str3 = '/home'; | |
| let str4 = '/a/../../../b'; | |
| let str5 = '/../'; | |
| function changeDirectory(str) { | |
| let result = "", | |
| ignoreChars = ['.', '..', '/', '//', ''], | |
| directoryArr = str.split('/'); |
Phone: (347) 742-6464
Email: [email protected]
LinkedIn: linkedin.com/in/ryan-omoruyi
GitHub: github.com/ryanomor
Technical: Java, Angular, Spring Boot, JavaScript, React, Redux, Node.js, RESTful API, AJAX, Git/GitHub, HTML, CSS, Express, SQL
| var isBalance = function(str) { | |
| if(str.length < 1) return false; | |
| let pairs = { | |
| '(': ')', | |
| '{': '}', | |
| '[': ']' | |
| }; | |
| let openers = []; // replace [] with: new Stack | |
| for (let index in str) { |
| const shortened = str => { | |
| let newStr = "", | |
| charCount = 1; | |
| for (let i = 0; i < str.length; i++) { | |
| if (charCount < 2 && str[i] != str[i + 1]) { | |
| newStr += str[i]; | |
| charCount = 1; | |
| } else if (str[i] != str[i + 1]) { | |
| newStr += str[i] + charCount; |
| function findTriplets(arr, n) { | |
| let idx2, idx3; | |
| arr.sort((a, b) => a - b); // sort arr in ascending order | |
| for(let i = 0; i < arr.length - 2; i++) { | |
| idx2 = i + 1; // index of the first element in the remaining list of elementss | |
| idx3 = arr.length - 1; // index of the last element | |
| while(idx2 < idx3) { | |
| if(arr[i] + arr[idx2] + arr[idx3] == n) { |
| let myArr = [1,2,3,4, | |
| 4,0,4,4, | |
| 7,0,1,4, | |
| 4,4,4,1], | |
| myArr2 = [1,2,3,4, | |
| 4,1,4,4, | |
| 7,0,1,4, | |
| 4,4,4,1]; |