Code Monkey home page Code Monkey logo

stage1-module4-collections-finaltask's Introduction

Tasks

1. Lessons Getter

Implement the program which gets timetable and returns set of all lessons without duplicates. Timetable is a Map<String, List<String>>, where the key - the day of the week and the value - List<String> of lessons for that day.

public class LessonsGetter {
    public Set<String> getLessons(Map<String, List<String>> timetable){
    }
}

Example

Input

Modnay - English
Tuesday - Mathematics
Wednesday - English, Chemistry
Thursday - Literature, Mathematics
Friday - Physics

Output

English, Mathematics, Chemistry, Literature, Physics

2. Map from keys Creator

Implement the program which gets Map<String, Integer> as parameter and returns a new Map<Integer, Set<String>>, where key - the lengths of the key from the source map, value - Set<String> of keys with corresponding length.

public class MapFromKeysCreator {
    public Map<Integer, Set<String>> createMap(Map<String, Integer> sourceMap){
    }
}

Example

Input

one - 1
two - 2
three - 3
five - 4
ten - 10

Output

3 - one, two, ten
4 - five
5 - three

3. Developer Project Finder

Implement the program which gets Map<String, List<String>> of projects and its developers and the required developer as parameters and returns a List<String> of projects for requested developer in descending order of project name length. If the names of the projects are of the same length, then sort alphabetically in reverse order.

public class DeveloperProjectFinder {
    public List<String> findDeveloperProject(Map<String, Set<String>> projects, String developer){

    }
}

Example

Input

Projects:
CSO - Ivan, Anna, Lidia, Antony
VVaS - Mary, Ben, Max, 
LJA - Oleg, Ivan, Alex
 
 Developer: Ivan

Output

CSO, LJA

stage1-module4-collections-finaltask's People

Contributors

hopenadyahope avatar bogdanovadiana avatar symbatdeveloper 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.