This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
void foo(double *output) { | |
for(int i = 0; i < 10; ++i) | |
output[i] = i; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait Flattanable[F[_]] { | |
def flatten[A](ff: F[F[A]]): F[A] | |
} | |
object Flattanable { | |
implicit def optionFlattanable: Flattanable[Option] = new Flattanable[Option] { | |
override def flatten[A](ff: Option[Option[A]]): Option[A] = ff match { | |
case Some(Some(v)) => Some(v) | |
case _ => None | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyCircularDeque: | |
def __init__(self, k: int): | |
""" | |
Initialize your data structure here. Set the size of the deque to be k. | |
""" | |
self._capacity = k | |
self._size = 0 | |
self._queue = [None] * self._capacity | |
self._head = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def _bst_helper(self, root, lower, upper): | |
if root is None: | |
return True | |
def within_contstraints(val): | |
if lower is None and upper is None: | |
return True | |
if lower is None: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Definition for a binary tree node. | |
# class TreeNode: | |
# def __init__(self, x): | |
# self.val = x | |
# self.left = None | |
# self.right = None | |
class Solution: | |
def helper(self, root: TreeNode, k: int): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Node: | |
def __init__(self, val, left=None, right=None): | |
self.val = val | |
self.left = left | |
self.right = right | |
class Solution: | |
def _helper(self, tree_root): | |
this_node = Node(tree_root.val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def decodeString(self, s: str) -> str: | |
multipliers = [] | |
sequences = [] | |
last_multiplier = 0 | |
last_sequence = '' | |
for c in s: | |
if c.isdigit(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Solution: | |
def decodeString(self, s: str) -> str: | |
multipliers = [] | |
sequences = [] | |
last_multiplier = 0 | |
last_sequence = '' | |
for c in s: | |
if c.isdigit(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats.effect.{IO, Timer} | |
import fs2.{Pull, Stream} | |
import org.http4s._ | |
import org.http4s.ServerSentEvent.EventId | |
import org.http4s.client.Client | |
import org.http4s.headers.{`Cache-Control`, Accept} | |
import scala.concurrent.duration._ | |
import SseClient._ | |
final class SseClient private ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.spark.sql.DataFrame | |
case class AnnotatedDataFrame[D](toDF: DataFrame) extends Serializable |
OlderNewer