Skip to content

DartFoundation/while_loop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome

while loop

Automated grading of homework assignments and tests

  • fork this repository
  • solve the task
  • commit with proper message

Problems

While01

Return the number of odd numbers up to A.

Example 1:

Input: s = 12
Output: 6

Example 2:

Input: s = 22
Output: 11

Constraints:

  • 1 <= length(s) <= 10^5

While02

Return the number of even numbers up to "a".

Example 1:

Input: s = 15
Output: 8

Example 2:

Input: s = 50
Output: 26

Constraints:

  • 1 <= length(s) <= 10^5

While03

Return the sum of odd numbers up to "a".

Example 1:

Input: s = 15
Output: 64

Constraints:

  • 1 <= length(s) <= 10^5

While04

Return the sum of even numbers up to "a".

Example 1:

Input: s = 20
Output: 110

Constraints:

  • 1 <= length(s) <= 10^5

While05

Find the difference between the sum of odd numbers and the sum of even numbers up to a.

Example 1:

Input: s = 50
Output: -25

Constraints:

  • 1 <= length(s) <= 10^5

While06

Return the larger of the odd and even numbers up to 'a', whichever is greater

Example 1:

Input: s = 10
Output: 30

Constraints:

  • 1 <= length(s) <= 10^5

While07

Return odd and even numbers up to "a", whichever is smaller

Example 1:

Input: s = 10
Output: 25

Constraints:

  • 1 <= length(s) <= 10^5

While08

return odd numbers as a string

Example 1:

Input: s = 10
Output: 13579

Constraints:

  • 1 <= length(s) <= 10^5

While09

return even numbers as a string

Example 1:

Input: s = 10
Output: 0246810

Constraints:

  • 1 <= length(s) <= 10^5

While10

If the number "a" is given, "tub son" is returned if it is a prime number, otherwise "tub son emas"

Example 1:

Input: s = 7
Output: "tub son"

Example 2:

Input: s = 8
Output: "tub son emas"

Constraints:

  • 1 <= length(s) <= 10^5

Warning

  • don't copy other solutions or any solution
  • don't remove comments

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages