How do you highlight a long test case?


  • 0
    D

    How do you copy and paste a test case that is a long array? There is no way to expand or highlight an input that runs off the end of the screen. You used to be able to click the input to expand it, but that no longer works.

    0_1494002550935_upload-a0c42bde-e452-4471-9da3-dbdf6b4b96e8


  • 0

    I think for me it still works, but sadly not as conveniently as until recently. It used to be a single click selecting the whole input. Now I need to double- or triple-click and drag.


  • 0
    D

    @StefanPochmann
    Really it still works for you? I can't seem to highlight the entire array pass the ellipses. I've looked in the HTML source and the whole array is not even loaded in the page sometimes.
    0_1494101234666_upload-25081853-1487-4c84-a971-d92b9192ad40


  • 0

    @david120 Can you tell the problem and show your code so I can try to replicate it better?


  • 0
    D

    @StefanPochmann I've been going through some older problems that I never did. In particular I was working on #135 Candy. My code is as follows:

    def candy(self, ratings):
        """
        :type ratings: List[int]
        :rtype: int
        """
        if not ratings: return 0
        N = len(ratings)
        
        dp = [1]*N
        def helper(i):
            if i == N-1: return dp[N-1]
            
            if ratings[i] < ratings[i+1]:
                dp[i+1] = dp[i] + 1
                helper(i+1)
            elif ratings[i] > ratings[i+1]:
                dp[i] = max(dp[i], helper(i+1) + 1)
            else:
                dp[i+1] = dp[i]
                helper(i+1)
            return dp[i]
        
        helper(0)
        return sum(dp)
    

    OJ tells me that I have a Runtime Error, but it doesn't give any line number where the code breaks. I'm sure I'm just doing something stupid, but I can't debug since I can't highlight the entire test case.

    0_1494105334597_upload-b7d6c444-14df-488e-bce4-236fb78b429e


  • 0

    @david120 Ok, I just tried that.

    In the Edge browser, triple-click did select the whole array (about 39000 bytes, ending in ,4099,8]) and ctrl-C and ctrl-V got the whole thing. Right-clicking and using "Inspect Element" also showed me the whole data.

    In Chrome, both ways are cut off after 10000 bytes (ending in ,6774,5297…). So way more than what's shown on the page, but not everything.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.