Skip to content

Instantly share code, notes, and snippets.

class ClassName {
factory ClassName(Object complicatedObject) => ClassName.internal(
complicatedObject,
// Creation of this object is handled in the constructor
Object(),
);
@visibleForTesting
ClassName.internal(
this._complicatedObject,
from collections import defaultdict
"""
"""
class Solution(object):
def minTransfers(self, transactions):
"""
:type transactions: List[List[int]]
:rtype: int
"""
#Stage 1 - Install dependencies and build the app
FROM debian:latest AS build-env
# Install flutter dependencies
RUN apt-get update
RUN apt-get install -y curl git wget unzip libgconf-2-4 gdb libstdc++6 libglu1-mesa fonts-droid-fallback lib32stdc++6 python3
RUN apt-get clean
# Clone the flutter repo
RUN git clone https://github.com/flutter/flutter.git /usr/local/flutter
import operator
import math
from itertools import permutations
import functools
class Solution(object):
def getProbability(self, balls):
"""
:type balls: List[int]
:rtype: float
# import pprint
class Solution(object):
def getProbability(self, balls):
"""
:type balls: List[int]
:rtype: float
"""
trie = {}
@pasindud
pasindud / prob.py
Last active February 19, 2021 11:01
class Solution(object):
def getProbability(self, balls):
"""
:type balls: List[int]
:rtype: float
"""
trie = {}
newballs = balls + balls[0:-1]
import 'dart:typed_data';
import 'dart:convert';
void main() {
final j = {'k' : 'ජෝන්', 'non_unicode': 'abc'};
/// Existing Version
final oldencoded = json.encode(j);
final oldutfencoded = Uint8List.fromList(oldencoded.codeUnits);
void main() {
final a = ['a', 'b', 'c'];
final b = [
for (final s in a)
for (final t in a) if (s != t) '${s}_$t'
];
print(b);
#! /bin/bash
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
apt-get update && apt-get install -y \
sox \
curl \
libicu-dev \
g++ \
git \
python \
python-dev \
python-setuptools \