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
| /* | |
| The following solution has been improved to incorporate | |
| requiring of the text module and to reflect a better | |
| structure / functional design. | |
| --- | |
| Unfortunately, a lack of sleep led to some disorganization | |
| within the initial solution. | |
| */ | |
| const fs = require('fs'); |
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 fs = require('fs'); | |
| const input = fs.readFileSync('./sample_input.txt').toString().split('\n'); | |
| const vowels = ['a', 'e', 'i', 'o', 'u']; | |
| function isVowel(letter) { | |
| return vowels.includes(letter); | |
| }; | |
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
| export function resetPassword(access_token, password, confirm_password) { | |
| let url = `https://vroom-com.appspot-preview.com/api/customers/newPassword?access_token=${access_token}`; | |
| return fetch(url, { | |
| method: 'PUT', | |
| headers: { | |
| 'Content-Type':'application/json', | |
| }, | |
| body: JSON.stringify({password: password, confirmation: confirm_password}) | |
| }) | |
| }; |
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 stack = new Stack(); // instantiate a new stack object | |
| stack.push(5); // adds 5 to the stack | |
| stack.push(6); | |
| stack.push(7); | |
| stack.isEmpty(); // => False | |
| stack.peek(); // => 7 | |
| stack.print(); // => 5,6,7 |
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
| function Stack() { | |
| // properties and methods go here. | |
| var items = []; // stores the element of the stack; | |
| // the push() method add elements to the end of the stack. | |
| this.push = function(e){ | |
| items.push(e); | |
| }; | |
| // the pop() method removes elements at the end of the stack and returns them. |
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
| Verifying that +lemuel is my blockchain ID. https://onename.com/lemuel |
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
| def function | |
| array = ["pblake", "xashley", "zkatie", "asteven"] | |
| array.sort do |a,b| | |
| a[1] <=> b[1] | |
| end | |
| end |
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
| arr = [1,2,3,4,5,6,7,8,9,10] | |
| other_arr = [] | |
| arr.each do |a| | |
| other_arr << a | |
| end | |
| puts other_arr[3] |