Given a one/two digit timing, calculate the possibilities of occurrence of other timings(including the glowing one) with relevant to glowing segments, assuming some segments may not be glowing.
Displaying the numbers is done using seven segment display. It is guaranteed that the sticks currently displaying are working fine..
Input : 78 Output :5 Input :05 Output :8
Example 1: 7 can be replaced by 5 different numbers 9, 3, 8, 0 and 7(if none of the segment is broken) and 8 can be replaced by only 1 number i.e 8 itself(if none of the segment is broken), therefore the answer is 5*1=5.
Example 2: 0 can be replaced by 2 numbers, 8 and 0, while 5 can be replaced by 4 different numbers. So, answer is 4*2=8.
Calculate for every number from 0–9 what all digits are possible by adding orremoving exactly one rod from the display. Store this in an array and the answer will be product of the array value of both the digits of the input.
Below is the implementation of above approach:
- Find the Nth Mosaic number
- Print first N terms of Lower Wythoff sequence
- Total number of possible Binary Search Trees using Catalan Number
- Find minimum difference between any two elements | Set 2
- Count common elements in two arrays containing multiples of N and M
- Nth number whose sum of digit is multiple of 10
- Generate elements of the array following given conditions
- Check whether a subsequence exists with sum equal to k if arr[i]> 2*arr[i-1]
- Maximize the happiness of the groups on the Trip
- Check whether two strings contain same characters in same order
- Longest string in an array which matches with prefix of the given string
- Find a way to fill matrix with 1's and 0's in blank positions
- Find the sum of the ascii values of characters which are present at prime positions
- Count of all possible values of X such that A % X = B
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : manishshaw1