Java, Scala, Nodejs, Go, Ruby, .NET, Python
- Hadoop
- Spark
- Kafka
- Flink
- Docker
- Kubernetes
class Solution { | |
public: | |
int solve(vector<vector<char>>& grid, int r, int c) { | |
if (!(r >= 0 && r < grid.size())) return 0; | |
if (!(c >= 0 && c < grid[r].size())) return 0; | |
if (grid[r][c] == '0') return 0; | |
grid[r][c] = '0'; | |
solve(grid, r, c-1); |
/** | |
* Definition for singly-linked list. | |
* struct ListNode { | |
* int val; | |
* ListNode *next; | |
* ListNode() : val(0), next(nullptr) {} | |
* ListNode(int x) : val(x), next(nullptr) {} | |
* ListNode(int x, ListNode *next) : val(x), next(next) {} | |
* }; | |
*/ |
""" | |
The MD5 is an algorithm that takes as input a message | |
of arbitrary length and produces as output a 128-bit "fingerprint" | |
or "message digest" of the input. Source: RFC 1321 | |
""" | |
# Constants | |
T = [0] * 64 | |
T[ 0: 3+1] = [ 0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee ] | |
T[ 4: 7+1] = [ 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501 ] |
import numpy as np | |
import sys | |
from numpy import linalg as LA | |
""" | |
This function takes square matrix and returns | |
the dominant eigin value and the smallest eigen value | |
and the value closest to a scalar k | |
""" | |
def solve(sq_matrix, k): |
let x,y,scl,delta,panSpeed | |
let translateX, translateY, prevX, prevY | |
function setup() { | |
createCanvas(400, 400) | |
delta = 1 // Will be -1 or 1 depending on the direction of the pan | |
panSpeed = 6 // How fast does the pan move | |
translateX = width/2 | |
translateY = height/2 | |
package main | |
import ( | |
"net/http" | |
"database/sql" | |
"fmt" | |
"log" | |
"os" | |
) |
package main | |
import ( | |
"fmt" | |
) | |
// Sample test data for the algorithm | |
var ( | |
PLAIN_TEXT = []byte("Text") | |
KEY = []byte("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA") |
class Rectangle: | |
def __init__(self, width, height): | |
self.width = width | |
self.height = height | |
self._id = 0 | |
def area(self): | |
return self.width * self.height | |
def perimeter(self): |
def solution(h, q): | |
root = (1 << h) - 1 | |
l = h-1 | |
queue = [root-(1<<l), root-1] | |
parent = [0 for _ in range(root+1)] | |
parent[root] = -1 | |
parent[queue[0]] = root | |
parent[queue[1]] = root | |
pows = 2 |