This file contains 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
import React from 'react'; | |
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | |
import { faMinusCircle } from '@fortawesome/free-solid-svg-icons' | |
import './cat-list.css'; | |
class CatList extends React.Component { | |
renderList() { | |
return null | |
} | |
render() { |
This file contains 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
/** | |
Developer comment | |
- we'll use regex to build few capturing groups with the next structure: | |
first: https://wwww | |
second: <the domain> | |
thrid: .<end of domain> | |
- than we pick the relevant group from the array (base on the code task requriement) | |
**/ | |
function domainName(url){ | |
return url.match(/^(https?:\/\/)?([w]+\.)?([a-z0-9-]+)\.[a-z]+/)[3]; |
This file contains 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
/** | |
Developer comment | |
- This is a difference function, which subtracts one list from another and returns the result. | |
- we'll go over all 'b' values | |
- we'll use filter to knock down each of 'b' values from 'a' array | |
**/ | |
function arrayDiff(a, b) { | |
let newArray = a; |
This file contains 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
/** | |
Developer comment | |
- This is a pseudo-encryption algorithm which given a string S and an integer N concatenates all the odd-indexed | |
characters of S with all the even-indexed characters of S, this process should be repeated N times. | |
- use recursive function | |
- decress the N | |
- every step encrypt the text | |
- make sure we have exist statement, than return the text | |
**/ | |
function encrypt(text, n) { |
This file contains 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
/** | |
Developer comments | |
- we want to write calculations using functions and get the results. example: seven(times(five())); // must return 35 | |
- use return to understand the structure those functinos are being called | |
- use array to pass and store all previous data of those functions | |
- build single function to resolve the array we build | |
**/ | |
function resolve(a) { | |
if(a.length >= 3) { | |
if(a[1] === '*') { |
This file contains 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 removeEveryOther(arr){ | |
return arr.filter((word, index) => !(index%2)); | |
} |
This file contains 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 smaller(nums) { | |
/** developer comment: | |
- we have to return the amount of numbers that are smaller than arr[i] to the right. | |
- example: smaller([5, 4, 3, 2, 1]) === [4, 3, 2, 1, 0] or smaller([1, 2, 0]) === [1, 1, 0] | |
- go over each elemt | |
- cut with slice base on current index | |
- filter which one is smaller then current value | |
- use lenght to count how smaller than me? | |
**/ | |
let res = nums.map((value, index, array) => { |
This file contains 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
/** | |
output of size = 5 example: | |
00000 | |
....0 | |
000.0 | |
0...0 | |
00000 | |
**/ |
This file contains 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
/** | |
array of game for example: | |
[['-','-','-','-','-','-','-'], | |
['-','-','-','-','-','-','-'], | |
['-','-','-','R','R','R','R'], | |
['-','-','-','Y','Y','R','Y'], | |
['-','-','-','Y','R','Y','Y'], | |
['-','-','Y','Y','R','R','R']]; | |
**/ |
This file contains 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
/** | |
example: | |
validSolution([ | |
[5, 3, 4, 6, 7, 8, 9, 1, 2], | |
[6, 7, 2, 1, 9, 5, 3, 4, 8], | |
[1, 9, 8, 3, 4, 2, 5, 6, 7], | |
[8, 5, 9, 7, 6, 1, 4, 2, 3], | |
[4, 2, 6, 8, 5, 3, 7, 9, 1], | |
[7, 1, 3, 9, 2, 4, 8, 5, 6], | |
[9, 6, 1, 5, 3, 7, 2, 8, 4], |