Skip to content

Instantly share code, notes, and snippets.

View MelulekiDube's full-sized avatar
😊
Focusing

MelulekiDube

😊
Focusing
View GitHub Profile
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
static char board_state[9];
static int values[9];
char ai_player = 'O', opponent = 'X';
int status = 0;
@MelulekiDube
MelulekiDube / lazy_propagation.c
Created August 9, 2020 16:23
Simple implementation of lazy propagation
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
# define create(type, size) ((type*) malloc(sizeof(type)*size)) //to be used to malloc just to keep code neat
void update_children(int i, int se, int nv);
int *lazy; // this is lazy propagation
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import java.io.*;
import java.util.Scanner;
<div id="errors" style="
background: #c00;
color: #fff;
display: none;
margin: -20px -20px 20px;
padding: 20px;
white-space: pre-wrap;
"></div>
<div id="root"></div>
<script>
package com.meluleki.corona.CoronaVirusApplicaion;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.http.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import java.lang.reflect.Type;
class Solution {
int min;
public int kSimilarity(String A, String B) {
if(A.length() != B.length()) return Integer.MAX_VALUE;
min = Integer.MAX_VALUE;
char [] a = A.toCharArray();
helper(a, B, 0, 0);
return min;
import java.util.*;
import java.io.File;
import java.io.IOException;
public class Main{
private Stack<Map<String, String>> stackTrace; // we are going to use this to store our maps
private Scanner sc; // scanner that we will use to read through the file
private StringBuilder output;
import java.util.Scanner;/*Always assume you will need this*/
public class Test1A /*Always create class with the file name*/{
public static void main( String[] arg){
/*Get rid of the scanner*/
Scanner sc = new Scanner(System.in);
/*start doing some work here
variable delcation follows here:
How to declare primitive which include int double float char boolean (these are not going to create objects):
<!doctype html>
<html lang="en">
<head>
<link href="css/style.css">
</head>
<body>
<h1>My Favourite Things</h1>