Code Monkey home page Code Monkey logo

practice-programs's Introduction

Practice Programs

Practice programs for absolute beginners. Each day a new set of program prompts is added to this repo. Students can use any language to write their solution. Please make sure to follow the guidelines below.

Guidelines

  • Use any of the recommended languages to solve the problem sets.
  • Flowcharts are not accepted as solutions.
  • User input can be ommited for brevity.
  • Orgranize your code in functions / classes.
  • It is acceptable and recommended to reuse code but only within a set.
  • Keep your solutions organized in a github repo.

Organization

The problems are organized in sets, each set is stored in corresponding markdown file. Each set has a list of problems, ordered in increasing difficulty that build on the previous problem.

Example

For example, for the following set

S000 by @keogami

  1. Write a function to add two numbers. add(1, 2) = 3
  2. Write a function that adds two arrays of number of equal lengths and returns a new array. addArray([1, 2, 3], [1, 2, 3]) = [2, 4, 6]
  3. Modify the previous function to handle the case of unequal lengths. addArray([1, 2, 3], [1, 2]) = [2, 4, 3]

The following is an acceptable solution (in javascript)

const add = (a, b) => a + b // prompt 1
const addArrayEqual = (arr1, arr2) => arr1.map((val, idx) => val + arr2[idx]) // prompt 2
// prompt 3
const addArray = (arr1, arr2) => {
  const larger = Math.max(arr1.length, arr2.length)
  const result = []
  for (let idx = 0;  idx < larger; idx++) {
    result.push((arr1[idx] ?? 0) + (arr2[idx] ?? 0))
  }
  return result
}

Disclaimer

  • These prompts in no way represent actual software engineering and application development, and are merely for the use of practicing problem solving.
  • These prompts do not intend to compete with leetcode or the likes, nor does it claims any level of effectiveness of such methods of learning.

practice-programs's People

Contributors

keogami 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.