Code Monkey home page Code Monkey logo

practice-questions-01's Introduction

VT Programming team lecture 2016.02.16

Multiples of 3 and 5

Time Limit: 2 seconds

Project Euler 1: https://projecteuler.net/problem=1

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Given some number N, what is the sum of all multiples of three and five that are strictly less than N?

Input
Each input will consist of a single integer on a single line giving N(10≤N≤10,000)N(10≤N≤10,000).

Output
Output a single number on a single line, giving the sum of all multiples of 3 or 5 below N.

Sample Input 1 10
Sample Output 1
23
Sample Input 2 1000
Sample Output 2
233168
Sample Input 3 381
Sample Output 3
33758

Anagrams

Time Limit: 2 seconds

This problem will ask you to recognize if two strings are anagrams of each other. Two strings are anagrams of each other if you can rearrange the letters of one to make the other (They have exactly the same letters, order not mattering).

Input
Input will consist of a single test case. You will be provided with two strings, aa and bb. Both strings will consist of lowercase alphabetical characters only.

Output
Print “‘true”’ if aa and bb are anagrams of each other, “‘false”’ otherwise.

Sample Input 1 tommarvoloriddle
iamlordvoldemort

Sample Output 1
true

Sample Input 2 zigging
zagging

Sample Output 2
false

#Removing Duplicates Time Limit: 2 seconds

You will be provided a list of integer numbers, you must output these numbers in the order you recieve them, but making sure you remove any duplicates.

Input
Input will consist of one test case. Input will begin with a single integer N, that will specify the number of integers that will be in the list. This will be followed by N integers on a single line.

Output
Output the numbers in the order they appear in the input, but removing the duplicate entries.

Sample Input 1 10
2 3 5 1 2 4 1 5 2 6

Sample Output 1
2 3 5 1 4 6

practice-questions-01's People

Contributors

mfcecilia avatar

Watchers

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