diff --git a/week2/victor/first_factorial.md b/week2/victor/first_factorial.md new file mode 100644 index 0000000..9c4824f --- /dev/null +++ b/week2/victor/first_factorial.md @@ -0,0 +1,16 @@ +--- +Author: Victor +Date: 2022-09-25 +--- + +First Factorial + + +Have the function FirstFactorial(num) take the num parameter being passed and return the factorial of it. + +For example: if num = 4, then your program should return (4 * 3 * 2 * 1) = 24. For the test cases, the range will be between 1 and 18 and the input will always be an integer. +Examples +Input: 4 +Output: 24 +Input: 8 +Output: 40320 \ No newline at end of file diff --git a/week4/victor/Word_count.js b/week4/victor/Word_count.js new file mode 100644 index 0000000..787301a --- /dev/null +++ b/week4/victor/Word_count.js @@ -0,0 +1,10 @@ + + +function WordCount(str) { + let words = str.split(' '); + return words.length; + +} + +// keep this function call here +WordCount(readline()); \ No newline at end of file diff --git a/week4/victor/Word_count.md b/week4/victor/Word_count.md new file mode 100644 index 0000000..e69de29 diff --git a/week4/victor/comments.md b/week4/victor/comments.md index e69de29..7b5d9ce 100644 --- a/week4/victor/comments.md +++ b/week4/victor/comments.md @@ -0,0 +1,12 @@ +--- +Author: Victor +Date: 2022-10-17 +--- + +Word Count +Have the function WordCount(str) take the str string parameter being passed and return the number of words the string contains (e.g. "Never eat shredded wheat or cake" would return 6). Words will be separated by single spaces. +Examples +Input: "Hello World" +Output: 2 +Input: "one 22 three" +Output: 3 diff --git a/week5/victor/comments.md b/week5/victor/comments.md new file mode 100644 index 0000000..e69de29 diff --git a/week8/Victor/AB_Check.js b/week8/Victor/AB_Check.js new file mode 100644 index 0000000..ea467ec --- /dev/null +++ b/week8/Victor/AB_Check.js @@ -0,0 +1,12 @@ +function ABCheck(str) { + + for (i = 0; i < str.length; i++) { + if(str[i] === 'a' && str[i+4] === 'b'){ + return true; + } + } + return false; +} + +// keep this function call here +console.log(ABCheck(readline())); \ No newline at end of file diff --git a/week8/Victor/AB_check.md b/week8/Victor/AB_check.md new file mode 100644 index 0000000..ca10829 --- /dev/null +++ b/week8/Victor/AB_check.md @@ -0,0 +1,12 @@ +--- +Author: Victor +Date: 7-11-22 +--- + +AB Check +Have the function ABCheck(str) take the str parameter being passed and return the string true if the characters a and b are separated by exactly 3 places anywhere in the string at least once (ie. "lane borrowed" would result in true because there is exactly three characters between a and b). Otherwise return the string false. +Examples +Input: "after badly" +Output: false +Input: "Laura sobs" +Output: true \ No newline at end of file diff --git a/week8/Victor/comments.md b/week8/Victor/comments.md new file mode 100644 index 0000000..e69de29