* feat(tools): add seed/solution restore script * chore(curriculum): remove empty sections' markers * chore(curriculum): add seed + solution to Chinese * chore: remove old formatter * fix: update getChallenges parse translated challenges separately, without reference to the source * chore(curriculum): add dashedName to English * chore(curriculum): add dashedName to Chinese * refactor: remove unused challenge property 'name' * fix: relax dashedName requirement * fix: stray tag Remove stray `pre` tag from challenge file. Signed-off-by: nhcarrigan <nhcarrigan@gmail.com> Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
		
			
				
	
	
		
			78 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			78 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
| ---
 | |
| id: 5a23c84252665b21eecc8040
 | |
| title: Sum multiples of 3 and 5
 | |
| challengeType: 5
 | |
| forumTopicId: 302332
 | |
| dashedName: sum-multiples-of-3-and-5
 | |
| ---
 | |
| 
 | |
| # --description--
 | |
| 
 | |
| The objective is to write a function that finds the sum of all positive multiples of 3 or 5 below *n*.
 | |
| 
 | |
| # --hints--
 | |
| 
 | |
| `sumMults` should be a function.
 | |
| 
 | |
| ```js
 | |
| assert(typeof sumMults == 'function');
 | |
| ```
 | |
| 
 | |
| `sumMults(10)` should return a number.
 | |
| 
 | |
| ```js
 | |
| assert(typeof sumMults(10) == 'number');
 | |
| ```
 | |
| 
 | |
| `sumMults(10)` should return `23`.
 | |
| 
 | |
| ```js
 | |
| assert.equal(sumMults(10), 23);
 | |
| ```
 | |
| 
 | |
| `sumMults(100)` should return `2318`.
 | |
| 
 | |
| ```js
 | |
| assert.equal(sumMults(100), 2318);
 | |
| ```
 | |
| 
 | |
| `sumMults(1000)` should return `233168`.
 | |
| 
 | |
| ```js
 | |
| assert.equal(sumMults(1000), 233168);
 | |
| ```
 | |
| 
 | |
| `sumMults(10000)` should return `23331668`.
 | |
| 
 | |
| ```js
 | |
| assert.equal(sumMults(10000), 23331668);
 | |
| ```
 | |
| 
 | |
| `sumMults(100000)` should return `2333316668`.
 | |
| 
 | |
| ```js
 | |
| assert.equal(sumMults(100000), 2333316668);
 | |
| ```
 | |
| 
 | |
| # --seed--
 | |
| 
 | |
| ## --seed-contents--
 | |
| 
 | |
| ```js
 | |
| function sumMults(n) {
 | |
| 
 | |
| }
 | |
| ```
 | |
| 
 | |
| # --solutions--
 | |
| 
 | |
| ```js
 | |
| function sumMults(n) {
 | |
|   var sum = 0;
 | |
|   for (var i = 1; i < n; i++) {
 | |
|     if (i % 3 == 0 || i % 5 == 0) sum += i;
 | |
|   }
 | |
|   return sum;
 | |
| }
 | |
| ```
 |