A PHP Error was encountered

Severity: Notice

Message: Undefined index: markdown

Filename: models/Languages.php

Line Number: 60

Backtrace:

File: /var/www/stikked/htdocs/application/models/Languages.php
Line: 60
Function: _error_handler

File: /var/www/stikked/htdocs/application/models/Pastes.php
Line: 516
Function: code_to_description

File: /var/www/stikked/htdocs/application/controllers/Main.php
Line: 693
Function: getPaste

File: /var/www/stikked/htdocs/index.php
Line: 315
Function: require_once

Find the Student that Will Replace the Chalk (Leet - Stikked

Find the Student that Will Replace the Chalk (Leet

From linkjob, 1 Week ago, written in , viewed 11 times.
URL https://paste.t1ip.com/view/4cbfbd1c Embed
Download Paste or View Raw
  1. # Find the Student that Will Replace the Chalk (LeetCode 1894)
  2.  
  3. Reduce k modulo the total chalk first, then walk once.
  4.  
  5. ```python
  6. def chalkReplacer(chalk, k):
  7.     k %= sum(chalk)
  8.     for i, c in enumerate(chalk):
  9.         if k < c:
  10.             return i
  11.         k -= c
  12. ```
  13.  
  14. For live interview practice, see [AI interview copilot](https://www.linkjob.ai/interview-copilot/).
  15.  
  16. (Affiliation: I work on Linkjob AI.)
  17.  

Reply to "Find the Student that Will Replace the Chalk (Leet"

Here you can reply to the paste above