Skip to content

Instantly share code, notes, and snippets.

View MikhailGolubtsov's full-sized avatar

Mikhail Golubtsov MikhailGolubtsov

  • Freelance in Germany
  • Berlin, Germany
View GitHub Profile
object Solution {
import collection.immutable.HashMap
type IndexKey = HashMap[Char, Int]
def solve(s: String) = {
val chars = s.toCharArray()
var sorted = HashMap[IndexKey, Int]()
for {
i <- 0 to s.length - 1
@MikhailGolubtsov
MikhailGolubtsov / DistributionTest
Created March 5, 2015 12:30
Hazelcast map-reduce example - counting distribution
import com.hazelcast.client.HazelcastClient;
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.client.config.ClientNetworkConfig;
import com.hazelcast.core.HazelcastInstance;
import com.hazelcast.core.IMap;
import com.hazelcast.mapreduce.Combiner;
import com.hazelcast.mapreduce.CombinerFactory;
import com.hazelcast.mapreduce.Context;
import com.hazelcast.mapreduce.Job;
import com.hazelcast.mapreduce.JobCompletableFuture;