This file contains hidden or 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
package main | |
import ( | |
"bufio" | |
"errors" | |
"fmt" | |
"io" | |
"strings" | |
) |
This file contains hidden or 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 { | |
public boolean searchMatrix(int[][] matrix, int target) { | |
int rows = matrix.length; | |
if (rows == 0) { | |
return false; | |
} | |
int cols = matrix[0].length; | |
if (cols == 0) { | |
return false; | |
} |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"os" | |
"os/exec" | |
"path/filepath" | |
) |
This file contains hidden or 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
package demo | |
import akka.actor.ActorSystem | |
import akka.http.scaladsl.Http | |
import akka.http.scaladsl.server.Directives.{complete, pathPrefix} | |
import akka.http.scaladsl.server.Route | |
import akka.stream.ActorMaterializer | |
import monix.execution.Scheduler | |
import ru.tinkoff.tschema.akkaHttp.{MkRoute, RoutableIn, Serve} | |
import ru.tinkoff.tschema.swagger.Tag |
This file contains hidden or 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 gym | |
import numpy as np | |
import tensorflow as tf | |
state_dim = 4 | |
action_dim = 2 | |
population_size = 5 | |
std = 0.1 | |
alpha = 0.1 |
This file contains hidden or 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
module Stepik () where | |
class (Enum a, Bounded a, Eq a) => SafeEnum a where | |
ssucc :: a -> a | |
ssucc x | x == maxBound = minBound | |
| otherwise = succ x | |
spred :: a -> a | |
spred x | x == minBound = maxBound | |
| otherwise = pred x |
This file contains hidden or 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
public class J2DMrq { | |
private int n; | |
private int[][] t = new int[0][0]; | |
private int m; | |
public void build(int[][] arr) { | |
n = arr.length; | |
m = arr[0].length; | |
t = new int[n << 2][m << 2]; |
This file contains hidden or 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 scala.util.Try | |
import shapeless._ | |
object ReqOps extends App { | |
trait ParamMapper[A <: HList, R <: HList] { | |
def map(hl: A): R | |
} | |
trait ParamChecker[A <: HList] { |