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 longestNiceSubstring = s => { | |
| // Brute-force. | |
| let result = ''; | |
| let max = 0; | |
| const adder = 32; // uppercase or lowercase compliment | |
| // Begin building the word from the left and appending 1 character at a time. | |
| for (let i=0; i<s.length-1; i++) { | |
| const hash = {}; | |
| let word = s[i]; |
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
| QUESTION 1/10 | |
| What is Al ethics? | |
| 1 point | |
| I How and why an Al system arrived at a particular outcome or recommendation | |
| An organization's act of governing Al through its corporate instructions, staff, processes, and systems | |
| ** A multidisciplinary field that investigates how to maximize Al's beneficial impacts while reducing risks and adverse impacts | |
| How to build and use Al in ways that align with human ethics and expectations | |
| QUESTION 2/10 | |
| In Al, what is fairness? |
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
| QUESTION 1/10 | |
| Which of these statements is true? | |
| 1 point | |
| ) Cognitive systems can only process neatly organized structured data | |
| Cognitive systems can only translate small volumes of audio data into their literal text translations at massive speeds | |
| Cognitive systems can derive mathematically precise answers following a rigid decision tree approach | |
| ** Cognitive systems can learn from their successes and failures | |
| QUESTION 2/10 | |
| Which of these statements is true? |
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
| Which of the following is NOT a good way to define Al? | |
| 1 point | |
| ) Al is Augmented Intelligence and is not intended to replace human intelligence rather extend human capabilities | |
| Al is the use of algorithms that enable computers to find patterns without humans having to hard code them manually | |
| I Al is the application of computing to solve problems in an intelligent way using algorithms. | |
| ** Al is all about machines replacing human | |
| Which of the following is an attribute of Strong or | |
| Generalized Al? | |
| 1 point |
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 plusOne = digits => { | |
| // Set the index to the last digit. | |
| let i = digits.length - 1; | |
| // If the index digit < 9, increment it and return answer. | |
| if (digits[i] < 9) { | |
| digits[i]++; | |
| return digits; | |
| } | |
| else { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "perl", | |
| "request": "launch", | |
| "name": "Perl Debug", |
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 eraseOverlapIntervals1 = intervals => { | |
| let count = 0; | |
| const hash = {}; | |
| // Sort intervals by their ending time ascending. | |
| intervals.sort((a, b) => { | |
| return a[1] - b[1]; | |
| }); | |
| // Build a list of all occupied slots. |
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
| messages = [ | |
| {'content': 'I hate this food.', 'truth': 1}, | |
| {'content': 'This movie is terrible.', 'truth': 1}, | |
| {'content': 'I really like this play.', 'truth': 0}, | |
| {'content': 'I am just not sure.', 'truth': 0}, | |
| {'content': 'I can\'t believe you would do something like that!', 'truth': 1}, | |
| {'content': 'This is absolutely unacceptable!', 'truth': 1}, | |
| {'content': 'I am so angry right now, I can\'t even think straight.', 'truth': 1}, | |
| {'content': 'How could you be so thoughtless?', 'truth': 1}, | |
| {'content': 'You have no idea how much you\'ve hurt me.', 'truth': 1}, |
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 birthday1(s, d, m) { | |
| // Naive approach, O(n^2) | |
| let count = 0; | |
| if (s && s.length) { | |
| for (let i=0; i<s.length - m + 1; i++) { | |
| // Find all contiguous groups of m-length from this point. | |
| let sum = 0; | |
| for (let j=i; j<i+m; j++) { |