Giter VIP home page Giter VIP logo

for_loop's Introduction

Welcome

For loop

Automated grading of homework assignments and tests

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

Problems

For_loop01

Given the list of numbers, return the sum of the numbers in the list

Example 1:

Input: [1,2,3,4,5]
Output: 15

Example 2:

Input: [6,3,1]
Output: 10

For_loop02

Given a list of numbers, return the sum of the numbers at even index in the list

Example 1:

Input: [7,1,5,2,8]
Output: 20

Example 2:

Input: [1,2,3,4,5]
Output: 9

Constraints:

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

For_loop03

Given a list of numbers, return the sum of the numbers at odd index in the list

Example 1:

Input: [7,8,3,5,2]
Output: 13

Example 2:

Input: [1,2,3,4,5]
Output: 5

Constraints:

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

For_loop04

Given the list of numbers, return the sum the even numbers in the list

Example 1:

Input: [5,3,2,8,5]
Output: 10

Example 2:

Input: [8,7,6,5,4]
Output: 18

Constraints:

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

For_loop05

Create a list ranging from K to N. Return the List

Example 1:

Input: [5,3,2,8,5]
Output: 13

Example 2:

Input: [8,7,6,5,4]
Output: 12

Constraints:

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

For_loop06

Given the list of numbers, return the sum of the numbers between k and n in the list

Example 1:

Input: [6,2,8,1,6,3,7], 2, 4
Output: 9

Example 2:

Input: [1,2,3,4,5], 0, 3
Output: 3

For_loop07

Given the list of numbers, return the sum of the even numbers between k and n in the list

Example 1:

Input: [5,6,7,8], 0, 3
Output: 5

Example 2:

Input: [1,8,2,5,3,7,4], 3, 7
Output: 7

Constraints:

For_loop08

Given the list of numbers, return the sum of the odd numbers between k and n in the list

Example 1:

Input: [1, 2, 3, 4, 5], 0, 4
Output: 6

Example 2:

Input: [7, 7, 2, 5, 1, 6], 2, 6
Output: 11

Constraints:

Warning

  • don't copy other solutions or any solution
  • don't remove commentsA sample command-line application with an entrypoint in bin/, library code in lib/, and example unit test in test/.

for_loop's People

Contributors

xmaxkambek avatar olimjonsn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.