I haven't written anything for a long time ~ Not because you don't want to write, but because there are too many things to write ~ Think too much ~ Time is really faster than I thought ~ It's almost over before you know it ~ This semester has fewer courses! Sometimes I feel bored and empty! So tired and helpless ~~ Ms can no longer find the feeling of having to attend classes, eat, go to the library, play, and take a bath with her classmates every day! I really miss that feeling. Now everyone is
fcc-Learning Note Convert HTML entities1> recently studied and practiced the FCC topics. This is really a good comparison, recommended to everyone.2> address of the Chinese version: https://www.freecodecamp.cn/, English version of the address: https://www.freecodecamp.org3> this time to write about a JS problem, called convert HTML entities.The rules require the following:Converts characters in a string,,,
([7,9,11,13,15],20) The return value should be 0+3+1+2 and, that is, 6.
My Code:functionpairwise (arr, arg) {if(arr.length===0){ return0; } varIdxarr=[]; Outerloop: for(vari=0;i){ if(typeofarr[i]== "Number"){ for(varj=i+1;j){ if(arr[i]+arr[j]===Arg) {Idxarr.push (i); Idxarr.push (j); Arr.splice (J,1, undefined); ContinueOuterloop; } } } } varSum=idxarr.reduce (function(A, B) {returnA +b;}); returnsum;} Pairwise ([1, 1, 1], 2);The back of the
Creates a function that accepts two or more arrays and returns an array of equivalent differential (symmetric difference) (or) of the given array △ ⊕ .
Gives two sets, such as a collectionA = {1, 2, 3}and collectionsB = {2, 3, 4}), and the mathematical term "equivalent differential" is a collection of all elements that are only one of the two sets (A △ B = C = {1, 4}). For incoming additional collections, such asD = {2, 3}), You should install the preceding principle to seek the result of the
) (date2[1]-date1[1]>0)) | | ((date2[0]-date1[0]===1) (date2[1]-date1[1]===0) date2[2]-date1[2]>=0)){ +date2str+= "," +date2[0]; A}Else if(date1[0]==Yearnow) { theDate1str=date1str.slice (0,-6); + } - //Put two dates in the same array output (if the same day in the same month, the code date2str useless, so the code can be improved). $datearr[datearr.length]=Date1str; $ if(Date1.tostring ()!==date2.tostring ()) { -datearr[datearr.length]=Date2str; - } the returnDatearr; -}In special
); }} permall (Arr,begin); //returns the number of adjacent non-duplicates returnPerarr.filter (function(val) {return!Val.match (REG); }). Length;} Permalone (' AaB ');
First, swap the first character with the character one by one after it.
Next , the first character is fixed, and all subsequent characters are arranged. At this point we are still dividing all the characters in the back into two parts: the first character of the following character, and all the characters after the
newarr as the array arr -Miss = Newarr.filter (function(value) { + returnArr.indexof (value) = = = 1; - }); + for(vark = 0; K ) { A //Converts a number in an array to a character again, at this point in the form of an array atMISS[K] =String.fromCharCode (Miss[k]); - } - //Convert an array to a string (I consider a case where more than one letter is missing) - varletter = Miss.join (' '); - returnLetter ; -}Else { in
function can implement a combination of two arrays, newArr1 and newArr2 to form a new array.1 newArr = Newarr1.concat (NEWARR2);Code:1 functiondiff (Arr1, arr2) {2 varNEWARR = [];3 4 functionComp1 (value) {5 if(Arr2.indexof (value) = = = 1) {6 return true;7 }8 }9 Ten functionCOMP2 (value) { One if(Arr1.indexof (value) = = = 1) { A return true; - } - } the varNEWARR1 =Arr1.filter (COMP1); - varNEWARR2 =Arr2.filte
adds back), and finally returns an array of arr; knowledge Point: (1) the Array.shift () method from the arrayDeleteThe first element, and returns the value of the element. This method changes the length of the array. (2) The Array.unshift () method adds one or more elements to the beginning of the array and returns the length of the new array. Code:1 functionDrop (arr, func) {2 //Drop them elements.3 varL=arr.length;4 for(vari=0;i){5 varFir=Arr.shift ();6 if(func (FIR)) {7 Arr.unsh
Sum All PrimesSum of prime numbers less than or equal to a given number.Only 1 and its own two approximate numbers are called prime numbers. For example, 2 is a prime number, because it can only be divisible by 1 and 2. 1 is not a prime number because it can only be divisible by itself.The given number is not necessarily prime.For LoopsArray.push ()Ideas:Find all the prime numbers from 0 to num, and then iterate through the accumulation;Knowledge Points:Prime numbers are not divisible by themsel
: css () 1. Returns the CSS property (not supported by shorthand CSS properties) $ ("P"). CSS ("color"); Gets the value of the color style property of the first paragraph2. Set CSS Properties $ ("P"). CSS ("Color", "red"); Set all paragraph elements to red7. Traversal: Parent () Gets the parents of each element in the current matching element collection (traversing a single level up the DOM tree) $ ("P"). Parent (". selected"); Find the parent element with the "selected" class for each par
banknotes of uniform face value, which is added in the IF statement above to the empty array arr . theA + = 1; + fi1 (); - } $ } $ if(Odd = = 0) { - //If you can change and have the rest, return a list of changes that should be recovered - returnarr; the}Else if(Odd > 0) { - //returns the string "Insufficient Funds" if the money in the radio is not enough to find zeroWuyi return"Insufficient Funds"; the } - } Wu
Recently, the company just handed me a new job to package and release the company's products Using InstallShield 12. Although I feel that I can learn some new software, but it still seems strange.
Is installed, and there is a is usage tutorial in
1232: [usaco 162 Nov] cheertime limit: 10 sec memory limit: MB
Submit: 578 solved: 403
[Submit] [Status]
Description
Farmer John became very lazy and he didn't want to continue to maintain the road for the cows to pass. the road is used to connect
Dear myself, from today on, let's live with pride and love yourself so much that no one will love you.
Dear myself, don't care too much about some people who care too much about some things. Let's face it with the best attitude, because the world
Chinese Men's Basketball
In the face of strong enemies
Not retreating this time
Fail
Is expected
But this time
Showdown with mengba
Their performance
Brave and fearless
Men's Basketball
Others say that our external line is not good.
But
So excited !! So excited !! In the just-concluded Chinese match against Slovenia, Wang Shipeng was one second before the game !! Antichao ~~~~~ Chinese team qualify !! How can I hide my emotions ~~~ Shouted out ~~~!!!! It's been a long time before
I have been back from Beijing for several days and my status has not been adjusted. A single game exposes many of my shortcomings.
When I went to Beijing, I didn't put too much pressure on myself. Try your best. The self-reliance is poor. I only
1. Flipping a stringSolution: First convert the string into an array, then use the reverse method of the array to flip the order of the arrays, and finally convert the array into strings.1 function reversestring (str) {2 var arr = []; 3 arr =
Topic:Design a Cashier program checkCashRegister() that takes the purchase price ( price ) as the first parameter, the payment amount ( cash ) as the second parameter, and the cash register in the Change ( cid ) as the third parameter.cidis a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.