coronasafe / admission_task Goto Github PK
View Code? Open in Web Editor NEWGlobal Digital Corps - Software Engineering Test Problem | Priority list
Global Digital Corps - Software Engineering Test Problem | Priority list
No explanation of problem is provided and no platform to solve the problem
I suggest avoiding the use of task priority as the identifier to pick a todo item. In any real-world-ish implementation, the priority is bound to be stored separately from any identifier.
Again, in real world implementations, it's common to have multiple todo items in a list that share the same priority.
So instead of using priority as an identifier, let's use that to sort the output of the program? For example, here's a sample scenario:
./tasks add 2 "A thing I need to do"
# Added task: "A thing I need to do" with priority 2
./tasks add 2 "Another thing I need to do"
# Added task: "Another thing I need to do" with priority 2
./tasks add 4 "A not-so-important thing I need to do"
# Added task: "A not-so-important thing I need to do" with priority 4
./tasks add 1 "Quite an important todo item"
# Added task: "Quite an important todo item" with priority 1
./tasks ls
# 1. Quite an important todo item [1]
# 2. A thing I need to do [2]
# 3. Another thing I need to do [2]
# 4. A not-so-important thing I need to do [4]
./tasks done 2
# Marked "A thing I need to do" as done
./tasks report
# Pending: 3
# 1. Quite an important todo item [1]
# 2. Another thing I need to do [2]
# 3. A not-so-important thing I need to do [4]
#
# Completed: 1
# 1. A thing I need to do
Note how the identifier is basically just indexing of an array sorted by priority.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.