Skip to content

Latest commit

 

History

History

Seven-segment Display

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Solution

CPP
JAVA
PYTHON

Approach

Hint 1
* Question is not asking next number, but asking next display, i.e, status of each LED(0/1) in (N + 1)th step.
Hint 2
* Each LED has either of 3 stages:- Working, Broken, Unknown
* Working and Broken are easy to work with. For Unknown, if it has to glow, then we can't tell if it is working or broken. So, Display ERROR! else Display corrsponding state(0/1) at that place
Hint 3
* If you are getting multiple sequence that diplay different numbers and all lead to same diplay pattern then show that pattern, because what ever number is being diplayed, you will see single pattern
* If all numbers leads to different LED patterns, then you can't decide which to display, hence display ERROR!
Hint 4
* If you are getting multiple sequence at the end, keep in mind for each sequence LED status will be different in different sequence, i.e., same element can be Working, Broken or Unknown for different sequence