https://github.com/yankouskia/additional_8
Strange watch
https://github.com/yankouskia/additional_8
Last synced: about 1 month ago
JSON representation
Strange watch
- Host: GitHub
- URL: https://github.com/yankouskia/additional_8
- Owner: yankouskia
- License: mit
- Created: 2017-02-22T16:46:52.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-02-23T09:17:08.000Z (about 8 years ago)
- Last Synced: 2025-01-21T12:35:43.003Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 486 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Strange watch
## Task
Let's imagine:
1) We have digital watch
2) Our watch uses 7th system base
3) We divide our day on `hours` hours and `minutes` minutes
4) Watch is divided on 2 parts - first for hours, second - for minutes.
5) Each part contains the number of digits for showing all possible values of hours(minutes)
6) If number of digits of current hours or minutes is less then max possible, the left digits will be `0`
7) Input parameters are in the 10th base system
Your task is to calculate how many times a day all digits on watch are different.
Example:
```js
howMany(2 /*hours*/, 3 /*minutes*/); // -> 4 : (0: 1), (0: 2), (1: 0), (1: 2)
howMany(8 /*hours*/, 2 /*minutes*/); // -> 5 : (02: 1), (03: 1), (04: 1), (05: 1), (06: 1)
```Write your code in `src/index.js`