Browse Source

feat(dr-strange): solution

1122-buz-zinga
davhojt 2 years ago committed by Dav Hojt
parent
commit
c6aea50a44
  1. 22
      subjects/dr-strange/README.md

22
subjects/dr-strange/README.md

@ -2,12 +2,14 @@
### Instructions
You have been given the mission to create a new sense of time! Normally a week has 7 days right? Well, that is about to change!
You have been given a mission to create a new sense of time. Normally a week has 7 days right? Well, that is about to change.
Instead of a normal week having only 7 days, it will have 14 days.
Let me explain, this new week will have 14 days, from `Monday` to `Sunday` then `secondMonday` to `secondSunday`.
Your purpose is to create a new function `addWeek`, that takes as parameter a `Date` and that will return what week day the given date is, according to your new week format.
Week number should be count from `0001-01-01`.
Days will instead have **14** days.
Let me explain; this new week will have 14 days, from `Monday` to `Sunday`, then `secondMonday` to `secondSunday`.
Your purpose is to create a new function named `addWeek`, that takes a `Date` as an argument. Your function should return the weekday as a string, according to our new 14-day week format.
The **epoch** of our new 14-day week is `0001-01-01`.
```
new week format:
@ -28,11 +30,15 @@ secondSaturday
secondSunday
```
Now imagine you have a doctor appointment and you have to wait some hours, but you do not want to wait, so you decided that you need to create a
function `timeTravel` that allows you to change the time according to your needs.
Now imagine you have an appointment with your doctor, and you have to wait some hours, and you do not want to wait. So you decide that you need to create a new function named `timeTravel`, that allows you to change the time according to your needs.
This function will give you the power to go backwards or forwards in time.
So, you will have a function that takes an object with the following `{date, hour, minute, second}`. This object will be responsible for changing the `hour`, `minute` and `second` of the given `date`.
Your function will take an `object` as an argument. You can see the `timeTravel` example below to see the structure of your function's argument.
Your objective is to
and a `Date` as arguments.an argument. T as an argument. This `{date, hour, minute, second}`. This object will be responsible for changing the `hour`, `minute` and `second` of the given `date`.
### Example

Loading…
Cancel
Save