How to calculate "holes" in timetable
        Posted  
        
            by genesiss
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by genesiss
        
        
        
        Published on 2010-06-08T09:48:05Z
        Indexed on 
            2010/06/08
            10:12 UTC
        
        
        Read the original article
        Hit count: 261
        
I've got a 2-dimensional array like this (it represents a timetable):
http://www.shrani.si/f/28/L6/37YvFye/timetable.png
Orange cells are lectures and whites are free time. How could I calculate number of free hours between lectures in the same day? (columns are days and rows are hours)
For example, in this table the result should be:
2 for first column
0 for second colum
--> The function returns 2 (because 2+0=2)
© Stack Overflow or respective owner