Sort by

recency

|

2621 Discussions

|

  • + 0 comments

    I was going through some algorithm problems like this one and honestly reading discussions helps more than the editorial sometimes. When I’m taking breaks, I usually read manga to reset my brain 😅 I’ve been using tachiyomi apk lately and it’s been super convenient since everything’s in one place. Helps keep the balance between grinding problems and not burning out.

  • + 0 comments

    Python 3

    def pickingNumbers(a):
        arr = Counter(a)
        return max(arr[i]+arr.get(i+1,0) for i in arr)
    
  • + 0 comments

    subarray

    English Etymology From sub- + array.

    Noun subarray (plural subarrays)

    (programming) A contiguous subset of an array. Usage notes A subarray is to be contrasted with a subsequence. A subsequence only needs to have the same ordering as the original array, a weaker condition than contiguity.

    If a string is viewed as an array of characters, then a substring is a subarray.

  • + 0 comments

    This is a nice problem to practice. The key idea is to count occurrences of each number and then check adjacent values (x and x + 1). Instead of comparing every pair, using a frequency array or map makes the solution efficient and easy to understand. The approach is a bit like following a Minecraft Jenny Mod guide, where step-by-step organization makes complex tasks simpler.

  • + 0 comments

    This is a nice problem to practice. The key idea is to count occurrences of each number and then check adjacent values (x and x + 1). Instead of comparing every pair, using a frequency array or map makes the solution efficient and easy to understand.