Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Question

Commonmark migration
Source Link

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.

##Input

Input

  • Two dates, in any format. The second date will always be later than the first.
  • A list of chapter numbers. This comma-separated list can contain single chapters (12) or inclusive ranges (1-3). Ex. 1-3,5,6,10-13.
  • A list of weekdays (represented by the first two letters of the name: Monday -> Mo) to exclude from the schedule. Ex. Mo,Tu,Fr.

Output

##Output OutputOutput will be a newline-separated list of dates and chapter numbers (see format below). The chapters should be evenly distributed over all days in the range, excluding the weekdays provided. If the chapters do not distribute evenly, have the days with lower amounts of chapters at the end of the period of time. Dates in output can be in a different format than input. Days with no chapters can be ommited, or just have no chapters with it.

Example:

Input: 9/17/2015 9/27/2015 1-15 Tu

Output:

9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.

##Input

  • Two dates, in any format. The second date will always be later than the first.
  • A list of chapter numbers. This comma-separated list can contain single chapters (12) or inclusive ranges (1-3). Ex. 1-3,5,6,10-13.
  • A list of weekdays (represented by the first two letters of the name: Monday -> Mo) to exclude from the schedule. Ex. Mo,Tu,Fr.

##Output Output will be a newline-separated list of dates and chapter numbers (see format below). The chapters should be evenly distributed over all days in the range, excluding the weekdays provided. If the chapters do not distribute evenly, have the days with lower amounts of chapters at the end of the period of time. Dates in output can be in a different format than input. Days with no chapters can be ommited, or just have no chapters with it.

Example:

Input: 9/17/2015 9/27/2015 1-15 Tu

Output:

9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.

Input

  • Two dates, in any format. The second date will always be later than the first.
  • A list of chapter numbers. This comma-separated list can contain single chapters (12) or inclusive ranges (1-3). Ex. 1-3,5,6,10-13.
  • A list of weekdays (represented by the first two letters of the name: Monday -> Mo) to exclude from the schedule. Ex. Mo,Tu,Fr.

Output

Output will be a newline-separated list of dates and chapter numbers (see format below). The chapters should be evenly distributed over all days in the range, excluding the weekdays provided. If the chapters do not distribute evenly, have the days with lower amounts of chapters at the end of the period of time. Dates in output can be in a different format than input. Days with no chapters can be ommited, or just have no chapters with it.

Example:

Input: 9/17/2015 9/27/2015 1-15 Tu

Output:

9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15
Tweeted twitter.com/StackCodeGolf/status/667013818392952833
added 24 characters in body
Source Link
GamrCorps
  • 7.6k
  • 2
  • 30
  • 61

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.

##Input

  • Two dates, in any format. The second date will always be later than the first.
  • A list of chapter numbers. This comma-separated list can contain single chapters (12) or inclusive ranges (1-3). Ex. 1-3,5,6,10-13.
  • A list of weekdays (represented by the first two letters of the name: Monday -> Mo) to exclude from the schedule. Ex. Mo,Tu,Fr.

##Output Output will be a newline-separated list of dates and chapter numbers (see format below). The chapters should be evenly distributed over all days in the range, excluding the weekdays provided. If the chapters do not distribute evenly, have the days with lower amounts of chapters at the end of the period of time. Dates in output can be in a different format than input. Days with no chapters can be ommited, or just have no chapters with it.

Example:

Input: 9/17/2015 9/27/2015 1-15 Tu

Output:

9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.

##Input

  • Two dates, in any format. The second date will always be later than the first.
  • A list of chapter numbers. This comma-separated list can contain single chapters (12) or inclusive ranges (1-3). Ex. 1-3,5,6,10-13.
  • A list of weekdays (represented by the first two letters of the name: Monday -> Mo) to exclude from the schedule. Ex. Mo,Tu,Fr.

##Output Output will be a newline-separated list of dates and chapter numbers (see format below). The chapters should be evenly distributed over all days in the range, excluding the weekdays provided. If the chapters do not distribute evenly, have the days with lower amounts of chapters at the end of the period of time. Dates in output can be in a different format than input. Days with no chapters can be ommited, or just have no chapters with it.

Example:

Input: 9/17/2015 9/27/2015 1-15 Tu

Output:

9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.

##Input

  • Two dates, in any format. The second date will always be later than the first.
  • A list of chapter numbers. This comma-separated list can contain single chapters (12) or inclusive ranges (1-3). Ex. 1-3,5,6,10-13.
  • A list of weekdays (represented by the first two letters of the name: Monday -> Mo) to exclude from the schedule. Ex. Mo,Tu,Fr.

##Output Output will be a newline-separated list of dates and chapter numbers (see format below). The chapters should be evenly distributed over all days in the range, excluding the weekdays provided. If the chapters do not distribute evenly, have the days with lower amounts of chapters at the end of the period of time. Dates in output can be in a different format than input. Days with no chapters can be ommited, or just have no chapters with it.

Example:

Input: 9/17/2015 9/27/2015 1-15 Tu

Output:

9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15
edited body
Source Link
GamrCorps
  • 7.6k
  • 2
  • 30
  • 61

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.

##Input

  • Two dates, in any format. The second date will always be later than the first.
  • A list of chapter numbers. This comma-separated list can contain single chapters (12) or inclusive ranges (1-3). Ex. 1-3,5,6,10-13.
  • A list of weekdays (represented by the first two letters of the name: Monday -> Mo) to exclude from the schedule. Ex. Mo, Tu, Fr.

##Output Output will be a newline-separated list of dates and chapter numbers (see format below). The chapters should be evenly distributed over all days in the range, excluding the weekdays provided. If the chapters do not distribute evenly, have the days with lower amounts of chapters at the end of the period of time. Dates in output can be in a different format than input. Days with no chapters can be ommited, or just have no chapters with it.

Example:

Input: 9/17/2015 9/27/2015 1-15 SuTu

Output:

9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.

##Input

  • Two dates, in any format. The second date will always be later than the first.
  • A list of chapter numbers. This comma-separated list can contain single chapters (12) or inclusive ranges (1-3). Ex. 1-3,5,6,10-13.
  • A list of weekdays (represented by the first two letters of the name: Monday -> Mo) to exclude from the schedule. Ex. Mo, Tu, Fr.

##Output Output will be a newline-separated list of dates and chapter numbers (see format below). The chapters should be evenly distributed over all days in the range, excluding the weekdays provided. If the chapters do not distribute evenly, have the days with lower amounts of chapters at the end of the period of time. Dates in output can be in a different format than input. Days with no chapters can be ommited, or just have no chapters with it.

Example:

Input: 9/17/2015 9/27/2015 1-15 Su

Output:

9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15

I have been recently told to read an entire physics textbook by the new year (true story, unfortunately). I need your help to determine what chapters I should read each day. This is where you come in.

##Input

  • Two dates, in any format. The second date will always be later than the first.
  • A list of chapter numbers. This comma-separated list can contain single chapters (12) or inclusive ranges (1-3). Ex. 1-3,5,6,10-13.
  • A list of weekdays (represented by the first two letters of the name: Monday -> Mo) to exclude from the schedule. Ex. Mo, Tu, Fr.

##Output Output will be a newline-separated list of dates and chapter numbers (see format below). The chapters should be evenly distributed over all days in the range, excluding the weekdays provided. If the chapters do not distribute evenly, have the days with lower amounts of chapters at the end of the period of time. Dates in output can be in a different format than input. Days with no chapters can be ommited, or just have no chapters with it.

Example:

Input: 9/17/2015 9/27/2015 1-15 Tu

Output:

9/17/2015: 1 2
9/18/2015: 3 4
9/19/2015: 5 6
9/20/2015: 7 8
9/21/2015: 9 10
9/23/2015: 11
9/24/2015: 12
9/25/2015: 13
9/26/2015: 14
9/27/2015: 15
edited body; edited title
Source Link
GamrCorps
  • 7.6k
  • 2
  • 30
  • 61
Loading
Source Link
GamrCorps
  • 7.6k
  • 2
  • 30
  • 61
Loading

AltStyle によって変換されたページ (->オリジナル) /