All submissions for this problem are available.
Alice is very interested to work with startups. One day Alice came to know that drawft.com/android is conducting an Hiring Contest. Then after googling about it, she came to know that Drawft is a chat application and one can communicate through drawings, hand written chat and many other exciting features.
As part of their Hiring Contest, they asked Alice to code a problem. Help Alice in getting placed in drawft.com/android
All you need to do is ...
Calculate the count R of numbers from 1 to the given number N which have atleast one closed loop. (i.e.. 0,4,6,8 and 9)
numbers with digits with closed loop are those which have atleast one closed area in their representation.
i.e. 4,6,8,9,0 are digits with closed loop.
1,2,3,5,7 are those digits which do not have a closed loop.
Input contains a single integer N
Output contains a single integer R
- 1 ≤ N ≤ 1000
Input: 20 Output: 10
The count of closed figures with in 20 is 10. i.e.,
(4,6,8,9,10,14,16,18,19,20 are considered as numbers which have atleast one closed loop)
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS|
Fetching successful submissions