Class Solution

  • All Implemented Interfaces:

    
    public final class Solution
    
                        

    1124 - Longest Well-Performing Interval\.

    Medium

    We are given hours, a list of the number of hours worked per day for a given employee.

    A day is considered to be a tiring day if and only if the number of hours worked is (strictly) greater than 8.

    A well-performing interval is an interval of days for which the number of tiring days is strictly larger than the number of non-tiring days.

    Return the length of the longest well-performing interval.

    Example 1:

    Input: hours = 9,9,6,0,6,6,9

    Output: 3

    Explanation: The longest well-performing interval is 9,9,6.

    Example 2:

    Input: hours = 6,6,6

    Output: 0

    Constraints:

    • <code>1 <= hours.length <= 10<sup>4</sup></code>

    • 0 &lt;= hours[i] &lt;= 16

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      Solution()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Integer longestWPI(IntArray hours)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait