Skip to content

Instantly share code, notes, and snippets.

View Zhomart's full-sized avatar
🏠
Working from home

Zhomart Mukhamejanov Zhomart

🏠
Working from home
View GitHub Profile
  1. Try going to each 8 direction, from queens position, until you face obstacle and just count
  2. I used set to check if movement hit the ostacle
defmodule Solution do

  def count(_, qr, qc, _, _) when qr == 0 or qc == 0, do: 0
  def count(n, qr, qc, _, _) when qr == n+1 or qc == n+1, do: 0
  def count(n, qr, qc, obs, speed) do
    if MapSet.member?(obs, {qr, qc}) do # if obstacle

Keybase proof

I hereby claim:

  • I am zhomart on github.
  • I am zhomart (https://keybase.io/zhomart) on keybase.
  • I have a public key ASAALqo70nrARE9pLkoC9BV9SdioRXXW2GrhXLQziu3fRQo

To claim this, I am signing this object:

@Zhomart
Zhomart / filebeat-index-template.json
Last active February 20, 2018 14:07 — forked from thisismitch/filebeat-index-template.json
Fix for elastic 6.0. Run: `curl -XPUT 'http://localhost:9200/_template/filebeat?pretty' [email protected] -H "Content-Type: application/json"`
{
"mappings": {
"_default_": {
"dynamic_templates": [
{
"template1": {
"mapping": {
"doc_values": true,
"ignore_above": 1024,
"index": "not_analyzed",

Keybase proof

I hereby claim:

  • I am zhomart on github.
  • I am zhomart (https://keybase.io/zhomart) on keybase.
  • I have a public key ASAWLQCYKhhq_Ze2i4WptYc4IpFq3V-HV4NMCLiTNJQ9jgo

To claim this, I am signing this object:

@Zhomart
Zhomart / load-parse.js
Created November 24, 2024 19:30
load-parse.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.load = void 0;
const load_js_1 = require("./load.js");
const parse_js_1 = require("./parse.js");
const parse5_adapter_js_1 = require("./parsers/parse5-adapter.js");
const dom_serializer_1 = __importDefault(require("dom-serializer"));
@Zhomart
Zhomart / Client.java
Created January 24, 2025 05:28
Http client/server example - java
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
class Client {
public static void main(String[] args) {
// main thread
package main
import (
"fmt"
"io"
"log"
"net"
"os"
"strings"
)