Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions week11/Victor/Ex_oh.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function ExOh(str) {

var xArray = str.match(/x/g);
var oArray = str.match(/o/g);

if (!xArray || !oArray) {
return false;
}
if (xArray.length === oArray.length) {
return true;
}
return false;

}


console.log(ExOh(readline()));
12 changes: 12 additions & 0 deletions week11/Victor/Ex_oh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
Author: Victor
Date: 22-11-22
---

Ex Oh
Have the function ExOh(str) take the str parameter being passed and return the string true if there is an equal number of x's and o's, otherwise return the string false. Only these two letters will be entered in the string, no punctuation or numbers. For example: if str is "xooxxxxooxo" then the output should return false because there are 6 x's and 5 o's.
Examples
Input: "xooxxo"
Output: true
Input: "x"
Output: false
Empty file added week11/Victor/comments.md
Empty file.
16 changes: 16 additions & 0 deletions week2/victor/first_factorial.md
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions week4/victor/Word_count.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@


function WordCount(str) {
let words = str.split(' ');
return words.length;

}

// keep this function call here
WordCount(readline());
Empty file added week4/victor/Word_count.md
Empty file.
12 changes: 12 additions & 0 deletions week4/victor/comments.md
Original file line number Diff line number Diff line change
@@ -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
Empty file added week5/victor/comments.md
Empty file.