import kotlin.math.ceil /** * 2870. Minimum Number of Operations to Make Array Empty * @see <a href="https://leetcode.com/problems/minimum-number-of-operations-to-make-array-empty">Source</a> */ fun interface MinOpToMakeArrayEmpty { operator fun invoke(nums: IntArray): Int } val minOpToMakeArrayEmptyCounting = MinOpToMakeArrayEmpty { nums -> val counter = mutableMapOf<Int, Int>() for (num in nums) { counter[num] = counter.getOrDefault(num, 0) + 1 } var ans = 0 for ((_, count) in counter) { if (count == 1) { return@MinOpToMakeArrayEmpty -1 } ans += ceil(count.
        
          
        
      
    
  Blogs
This theme uses Prism for code highlighting. Other Hugo themes usually include a pre-configured version of Prism, which complicates updates and clutters the source code base with third-party JavaScript.
Only the Prism features you select in the Hugo site configuration are bundled by
the build process. This way, Prism can be easily updated with npm and the
size of the JavaScript and CSS bundles are minimized by only including what you
need.
      
        Sample article showcasing basic Markdown syntax and formatting for HTML elements.
      
    
  
      
        A brief description of Hugo Shortcodes
      
    
  
      
        Lorem Ipsum Dolor Si Amet
      
    
  
      
        A brief guide to setup KaTeX
      
    
  
      
        Guide to emoji usage in Hugo