Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Full time bug #1

Open
wants to merge 5 commits into
base: full-time
Choose a base branch
from
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
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion problems/01-get-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Write a function called getKeys(obj) that iterates through the object and
returns an array of the object's keys only.
*/

// Your code here
// Your code here

// const obj = {
// first: "1",
Expand Down
2 changes: 1 addition & 1 deletion problems/02-get-2c-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Write a function called get2CKeys(obj) that iterates through the object and
returns an array of the object's keys that have values with at least 2 'c's.
*/

// Your code here
// Your code here

// const obj = {
// red: 'circle',
Expand Down
2 changes: 1 addition & 1 deletion problems/03-get-values.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Write a function called getValues(obj) that iterates through the object and
returns an array of the object's values only.
*/

// Your code here
// Your code here

// const car = {
// make: 'Toyota',
Expand Down
2 changes: 1 addition & 1 deletion problems/04-object-to-array.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ is formatted such that the first element is the key and the second element is
the value.
*/

// Your code here
// Your code here

// let bootcamp = {
// name: "App Academy",
Expand Down
2 changes: 1 addition & 1 deletion problems/05-object-to-array-sum.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ nested array is formatted such that the first element is the key and the second
element is the sum of all the numbers in the array value.
*/

// Your code here
// Your code here

// let populations = {
// neighborhood1: [10, 1, 3, 6],
Expand Down
2 changes: 1 addition & 1 deletion problems/06-refactor-get-vowel-keys.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Given the function getVowelKeys(obj) below that iterates through an object and
returns all values associated with keys that are vowels using Object.keys(),
returns all values associated with keys that have vowels using Object.keys(),
refactor the code to not use Object.keys() but still passes the test specs.

Key point here is to note how there are multiple ways to iterate through an
Expand Down
2 changes: 1 addition & 1 deletion problems/07-common-keys.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ common keys between the two input objects, obj1 and obj2.
*/

function commonKeys(obj1, obj2) {
// Your code here
// Your code here
}

// console.log(commonKeys(
Expand Down
2 changes: 1 addition & 1 deletion problems/08-count-characters.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ the characters show up in the string as values.
*/

function countCharacters(str) {
// Your code here
// Your code here
}

// console.log(countCharacters('hello')); // => { h: 1, e: 1, l: 2, o: 1}
Expand Down
2 changes: 1 addition & 1 deletion problems/09-count-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ the elements show up in the string as values.
*/

function countElements(arr) {
// Your code here
// Your code here
}

// console.log(countElements(
Expand Down
2 changes: 1 addition & 1 deletion problems/10-get-scores.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ should be the value of the score key in the nested objects in the input array.
*/

function getScores(arr) {
// Your code here
// Your code here
}

// console.log(getScores([
Expand Down
26 changes: 26 additions & 0 deletions problems/11-is-palindrome-anagram.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
Given a sentence, write a function called isPalindromeAnagram that returns true if the
sentence can be rearranged into a palindrome and false if not. Ignore whitespace
and assume all characters are lowercase.

Note: A palindrome is a sequence that reads the same backwards as is does
forward.
*/

const isPalindromeAnagram = sentence => {
// Your code here
};

// console.log(isPalindromeAnagram('pop')); // true;
// console.log(isPalindromeAnagram('kayak')); // true
// console.log(isPalindromeAnagram('yo banana boy')); // true
// console.log(isPalindromeAnagram('this is the truth')); // false
// console.log(isPalindromeAnagram('abab')); // true
// // because 'abab' can be rearranged into a palindrome, 'abba'


/******************** DO NOT MODIFY ANY CODE BELOW THIS LINE *****************/

try {
module.exports = isPalindromeAnagram;
} catch {}
26 changes: 0 additions & 26 deletions problems/11-is-palindrome.js

This file was deleted.

2 changes: 1 addition & 1 deletion problems/12-are-anagrams.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CHALLENGE: Can you do it with just one object?
*/

function areAnagrams(word1, word2) {
// Your code here
// Your code here
}

// console.log(areAnagrams("cat", "act")); // true
Expand Down
21 changes: 21 additions & 0 deletions test/11-is-palindrome-anagram-spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const chai = require("chai");
const expect = chai.expect;
const isPalindromeAnagram = require("../problems/11-is-palindrome-anagram");

describe("isPalindromeAnagram", function() {
it("isPalindromeAnagram('pop') returns true", function () {
expect(isPalindromeAnagram('pop')).to.be.true;
});
it("isPalindromeAnagram('kayak') returns true", function () {
expect(isPalindromeAnagram('kayak')).to.be.true;
});
it("isPalindromeAnagram('yo banana boy') returns true", function () {
expect(isPalindromeAnagram('yo banana boy')).to.be.true;
});
it("isPalindromeAnagram('this is the truth') returns false", function () {
expect(isPalindromeAnagram('this is the truth')).to.be.false;
});
it("isPalindromeAnagram('abab') returns true", function () {
expect(isPalindromeAnagram('abab')).to.be.true;
});
});
21 changes: 0 additions & 21 deletions test/11-is-palindrome-spec.js

This file was deleted.